mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-10-27 08:43:05 +00:00
Update roles/kubernetes/tasks/main.yml
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
|
||||
- name: Install containerd
|
||||
apt:
|
||||
name: containerd
|
||||
@ -33,7 +32,6 @@
|
||||
deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /
|
||||
|
||||
|
||||
|
||||
- name: Install Kubernetes components
|
||||
apt:
|
||||
name:
|
||||
@ -48,6 +46,15 @@
|
||||
apt-mark hold kubelet kubeadm kubectl
|
||||
|
||||
|
||||
- name: Desativar swap
|
||||
ansible.builtin.command: swapoff -a
|
||||
|
||||
- name: Garantir que swap está desativado no fstab
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/fstab
|
||||
regexp: '.*swap.*'
|
||||
state: absent
|
||||
|
||||
|
||||
- name: Ativar ip_forward de forma idempotente
|
||||
ansible.builtin.sysctl:
|
||||
@ -56,6 +63,14 @@
|
||||
state: present
|
||||
reload: yes
|
||||
|
||||
- name: Configurar sysctl para Kubernetes
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/sysctl.d/k8s.conf
|
||||
content: |
|
||||
net.bridge.bridge-nf-call-iptables = 1
|
||||
net.bridge.bridge-nf-call-ip6tables = 1
|
||||
net.ipv4.ip_forward = 1
|
||||
|
||||
- name: Reload sysctl
|
||||
ansible.builtin.command: sysctl --system
|
||||
when: ansible_facts['os_family'] == 'Debian'
|
||||
|
||||
Reference in New Issue
Block a user