Update roles/kubernetes/tasks/main.yml

This commit is contained in:
2025-10-20 13:49:55 +00:00
parent 88ad914efe
commit c0022c470d

View File

@ -23,28 +23,42 @@
state: present state: present
update_cache: yes update_cache: yes
- name: Adding Docker GPG key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Adding Docker Repository - name: Instalar containerd
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
- name: Installation of Docker
become: true become: true
apt: apt:
name: name: containerd
- docker-ce
- docker-ce-cli
- containerd.io
- docker-compose
state: present state: present
update_cache: yes update_cache: yes
- name: Criar diretório de configuração do containerd
become: true
file:
path: /etc/containerd
state: directory
mode: '0755'
- name: Gerar config.toml padrão do containerd
become: true
command: containerd config default > /etc/containerd/config.toml
args:
creates: /etc/containerd/config.toml
- name: Ativar SystemdCgroup no containerd
become: true
replace:
path: /etc/containerd/config.toml
regexp: 'SystemdCgroup = false'
replace: 'SystemdCgroup = true'
- name: Reiniciar e habilitar containerd
become: true
systemd:
name: containerd
state: restarted
enabled: true
- 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