mirror of
https://gitea.fenix-dev.com/fenix-gitea-admin/iac-ansible-private.git
synced 2025-10-27 16:53:04 +00:00
Update roles/kubernetes/tasks/main.yml
This commit is contained in:
@ -1,64 +1,12 @@
|
|||||||
- name: Definir variáveis do CRI-O
|
- name: Install containerd
|
||||||
set_fact:
|
|
||||||
cri_o_version: "1.24"
|
|
||||||
os_version: "xUbuntu_22.04"
|
|
||||||
|
|
||||||
|
|
||||||
- name: Criar diretório de logs do CRI-O
|
|
||||||
become: yes
|
|
||||||
file:
|
|
||||||
path: /var/log/crio
|
|
||||||
state: directory
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Adicionar chave GPG do repositório CRI-O
|
|
||||||
become: yes
|
|
||||||
apt_key:
|
|
||||||
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ cri_o_version }}/{{ os_version }}/Release.key"
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Adicionar repositório principal do CRI-O
|
|
||||||
become: yes
|
|
||||||
apt_repository:
|
|
||||||
repo: "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ cri_o_version }}/{{ os_version }}/ /"
|
|
||||||
state: present
|
|
||||||
filename: "cri-o"
|
|
||||||
|
|
||||||
- name: Atualizar cache do APT
|
|
||||||
become: yes
|
|
||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
name: containerd
|
||||||
|
|
||||||
|
|
||||||
- name: Instalar runc
|
|
||||||
become: yes
|
|
||||||
apt:
|
|
||||||
name: runc
|
|
||||||
state: present
|
state: present
|
||||||
|
update_cache: no
|
||||||
|
|
||||||
- name: Corrigir caminho do runc no crio.conf
|
- name: Hold Kubernetes packages
|
||||||
become: yes
|
ansible.builtin.shell: |
|
||||||
replace:
|
apt-mark hold containerd
|
||||||
path: /etc/crio/crio.conf
|
|
||||||
regexp: '^runtime_path =.*'
|
|
||||||
replace: 'runtime_path = "/usr/sbin/runc"'
|
|
||||||
|
|
||||||
- name: Instalar CRI-O e ferramentas
|
|
||||||
become: yes
|
|
||||||
apt:
|
|
||||||
name:
|
|
||||||
- cri-o
|
|
||||||
- cri-tools
|
|
||||||
state: present
|
|
||||||
|
|
||||||
- name: Reiniciar CRI-O
|
|
||||||
become: yes
|
|
||||||
systemd:
|
|
||||||
name: crio
|
|
||||||
state: restarted
|
|
||||||
enabled: yes
|
|
||||||
#- name: Add Kubernetes APT key
|
#- name: Add Kubernetes APT key
|
||||||
# apt_key:
|
# apt_key:
|
||||||
# url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
# url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
|
||||||
|
|||||||
Reference in New Issue
Block a user