2020-04-22 20:29:45 +00:00
|
|
|
---
|
|
|
|
|
2020-04-24 08:18:07 +00:00
|
|
|
- name: CRI-O kubic repo name for debian os family
|
|
|
|
set_fact:
|
|
|
|
crio_kubic_debian_repo_name: "{{ ((ansible_distribution == 'Ubuntu') | ternary('x','')) ~ ansible_distribution ~ '_' ~ ansible_distribution_version }}"
|
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
|
2020-10-13 09:08:26 +00:00
|
|
|
- name: Add CRI-O kubic apt repo key
|
2020-04-22 20:29:45 +00:00
|
|
|
apt_key:
|
2020-04-24 08:18:07 +00:00
|
|
|
url: "https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/{{ crio_kubic_debian_repo_name }}/Release.key"
|
2020-04-22 20:29:45 +00:00
|
|
|
state: present
|
2020-04-24 08:18:07 +00:00
|
|
|
when: crio_kubic_debian_repo_name is defined
|
2020-07-07 19:32:01 +00:00
|
|
|
register: apt_key_download
|
|
|
|
until: apt_key_download is succeeded
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | d(3) }}"
|
2020-04-22 20:29:45 +00:00
|
|
|
|
2020-10-13 09:08:26 +00:00
|
|
|
- name: Add CRI-O kubic apt repo
|
2020-04-22 20:29:45 +00:00
|
|
|
apt_repository:
|
2020-04-24 08:18:07 +00:00
|
|
|
repo: "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/{{ crio_kubic_debian_repo_name }}/ /"
|
2020-04-22 20:29:45 +00:00
|
|
|
state: present
|
2020-10-13 09:08:26 +00:00
|
|
|
filename: devel-kubic-libcontainers-stable
|
2020-04-24 08:18:07 +00:00
|
|
|
when: crio_kubic_debian_repo_name is defined
|
2020-04-22 20:29:45 +00:00
|
|
|
|
2020-10-13 09:08:26 +00:00
|
|
|
- name: Add CRI-O kubic cri-o apt repo
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/{{ crio_kubic_debian_repo_name }}/ /"
|
|
|
|
state: present
|
|
|
|
filename: devel-kubic-libcontainers-stable-cri-o
|
|
|
|
when: crio_kubic_debian_repo_name is defined
|
|
|
|
|
|
|
|
- name: Add CRI-O kubic yum repo
|
2020-04-22 20:29:45 +00:00
|
|
|
yum_repository:
|
2020-04-24 08:18:07 +00:00
|
|
|
name: devel_kubic_libcontainers_stable
|
|
|
|
description: Stable Releases of Upstream github.com/containers packages (CentOS_$releasever)
|
2020-09-15 13:28:07 +00:00
|
|
|
baseurl: http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_$releasever/
|
2020-04-24 08:18:07 +00:00
|
|
|
gpgcheck: yes
|
|
|
|
gpgkey: http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/CentOS_$releasever/repodata/repomd.xml.key
|
2020-11-23 07:47:35 +00:00
|
|
|
keepcache: false
|
2020-04-24 08:18:07 +00:00
|
|
|
when: ansible_distribution in ["CentOS"]
|
2020-04-22 20:29:45 +00:00
|
|
|
|
2020-10-13 09:08:26 +00:00
|
|
|
- name: Add CRI-O kubic yum repo
|
2020-04-24 08:18:07 +00:00
|
|
|
yum_repository:
|
|
|
|
name: "devel_kubic_libcontainers_stable_cri-o_{{ crio_version }}"
|
2020-06-04 08:08:44 +00:00
|
|
|
description: "CRI-O {{ crio_version }} (CentOS_$releasever)"
|
2020-09-15 13:28:07 +00:00
|
|
|
baseurl: "http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_$releasever/"
|
2020-04-24 08:18:07 +00:00
|
|
|
gpgcheck: yes
|
2020-09-15 13:28:07 +00:00
|
|
|
gpgkey: "http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/{{ crio_version }}/CentOS_$releasever/repodata/repomd.xml.key"
|
2020-04-24 08:18:07 +00:00
|
|
|
when: ansible_distribution in ["CentOS"]
|
|
|
|
|
|
|
|
- name: Enable modular repos for CRI-O
|
2020-04-22 20:29:45 +00:00
|
|
|
ini_file:
|
2020-07-13 14:18:32 +00:00
|
|
|
path: "/etc/yum.repos.d/{{ item.repo }}.repo"
|
|
|
|
section: "{{ item.section }}"
|
2020-04-22 20:29:45 +00:00
|
|
|
option: enabled
|
|
|
|
value: 1
|
|
|
|
become: true
|
2020-04-24 08:18:07 +00:00
|
|
|
when: is_ostree
|
2020-04-22 20:29:45 +00:00
|
|
|
loop:
|
2020-07-13 14:18:32 +00:00
|
|
|
- repo: "fedora-updates-modular"
|
|
|
|
section: "updates-modular"
|
|
|
|
- repo: "fedora-modular"
|
|
|
|
section: "fedora-modular"
|
2020-04-24 08:18:07 +00:00
|
|
|
|
|
|
|
- name: Enable CRI-O module
|
|
|
|
command: "dnf -y module enable cri-o:{{ crio_version }}"
|
|
|
|
args:
|
|
|
|
warn: False
|
|
|
|
register: crio_dnf_result
|
|
|
|
changed_when: "'Enabling' in crio_dnf_result.stdout"
|
|
|
|
become: true
|
|
|
|
when:
|
|
|
|
- ansible_distribution in ["Fedora"]
|
|
|
|
- not is_ostree
|