Update roles/kubernetes/tasks/main.yml

This commit is contained in:
2025-10-20 12:51:59 +00:00
parent 5401347945
commit 34cc967d0b

View File

@ -4,41 +4,41 @@
state: stopped state: stopped
enabled: false enabled: false
- name: Disable SWAP - name: Disable SWAP
shell: | shell: |
swapoff -a swapoff -a
- name: Disable SWAP in fstab - name: Disable SWAP in fstab
lineinfile: lineinfile:
path: /etc/fstab path: /etc/fstab
regexp: '^.*swap.*$' regexp: '^.*swap.*$'
line: '#\0' line: '#\0'
backrefs: yes backrefs: yes
- name: ensure net.bridge.bridge-nf-call-ip6tables is set to 1 - name: ensure net.bridge.bridge-nf-call-ip6tables is set to 1
sysctl: sysctl:
name: net.bridge.bridge-nf-call-iptables name: net.bridge.bridge-nf-call-iptables
value: '1' value: '1'
state: present state: present
reload: yes reload: yes
- name: Installation of apt-utils - name: Installation of apt-utils
apt: apt:
name: apt-transport-https name: apt-transport-https
state: present state: present
update_cache: yes update_cache: yes
- name: Adding Docker GPG key - name: Adding Docker GPG key
ansible.builtin.apt_key: ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg url: https://download.docker.com/linux/ubuntu/gpg
state: present state: present
- name: Adding Docker Repository - name: Adding Docker Repository
apt_repository: apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present state: present
- name: Installation of Docker - name: Installation of Docker
apt: apt:
name: "{{ item }}" name: "{{ item }}"
state: present state: present
@ -48,12 +48,12 @@
- containerd.io - containerd.io
- docker-compose - docker-compose
- name: Setting value of SystemdCgroup - name: Setting value of SystemdCgroup
shell: | shell: |
containerd config default | sudo tee /etc/containerd/config.toml | grep SystemdCgroup containerd config default | sudo tee /etc/containerd/config.toml | grep SystemdCgroup
sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml sed -i 's/SystemdCgroup = false/SystemdCgroup = true/g' /etc/containerd/config.toml
- name : Starting Service of Docker - name : Starting Service of Docker
service: service:
name: docker name: docker
state: started state: started