TP-IaC-Kubernetes/roles/CRIO/tasks/main.yaml

69 lines
2.3 KiB
YAML

- name: install container runtime CRI-O source
become: yes
block:
- name: Create a /usr/share/keyrings
ansible.builtin.file:
path: /usr/share/keyrings
state: directory
mode: '0755'
- name: get key libcontainer
get_url:
url: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ os }}/Release.key
dest: /usr/share/keyrings/libcontainer.key
- name: get gpg libcontainer
shell: cat /usr/share/keyrings/libcontainer.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg
args:
chdir: /usr/share/keyrings
creates: /usr/share/keyrings/libcontainers-archive-keyring.gpg
- name: get key crio
get_url:
url: https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ version }}/{{ os }}/Release.key
dest: /usr/share/keyrings/crio.key
- name: get gpg crio
shell: cat /usr/share/keyrings/crio.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg
args:
chdir: /usr/share/keyrings
creates: /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg
- name: libcontainer | apt source
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ os }}/ /"
state: present
- name: crio | apt source
ansible.builtin.apt_repository:
repo: "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ version }}/{{ os }}/ /"
state: present
- name: install container runtime CRI-O
ansible.builtin.apt:
pkg:
- cri-o
- cri-o-runc
- cri-tools
become: yes
- name: change crio.conf
become: yes
template:
src: etc/crio/crio.conf
dest: /etc/crio/crio.conf
- name: change 100-crio-bridge.conflist
become: yes
template:
src: etc/cni/net.d/100-crio-bridge.conflist.j2
dest: /etc/cni/net.d/100-crio-bridge.conflist
- name: Restart service CRI-O
become: yes
ansible.builtin.systemd:
enabled: true
state: restarted
daemon_reload: true
name: crio