2017-02-24 05:08:18 +01:00
|
|
|
---
|
2017-05-10 04:36:53 +02:00
|
|
|
- name: Ensure old versions of Docker are not installed.
|
|
|
|
package:
|
2018-10-23 06:32:38 +02:00
|
|
|
name:
|
|
|
|
- docker
|
|
|
|
- docker-common
|
|
|
|
- docker-engine
|
2017-05-10 04:36:53 +02:00
|
|
|
state: absent
|
|
|
|
|
2017-02-24 05:21:00 +01:00
|
|
|
- name: Add Docker GPG key.
|
|
|
|
rpm_key:
|
2019-03-19 19:33:20 +01:00
|
|
|
key: "{{ docker_yum_gpg_key }}"
|
2017-02-24 05:21:00 +01:00
|
|
|
state: present
|
2022-12-14 16:31:46 +01:00
|
|
|
when: docker_add_repo | bool
|
2017-02-24 05:08:18 +01:00
|
|
|
|
|
|
|
- name: Add Docker repository.
|
2017-05-10 04:36:53 +02:00
|
|
|
get_url:
|
|
|
|
url: "{{ docker_yum_repo_url }}"
|
|
|
|
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
2017-02-24 05:21:00 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0644
|
2022-12-14 16:31:46 +01:00
|
|
|
when: docker_add_repo | bool
|
2017-05-10 04:36:53 +02:00
|
|
|
|
2020-12-27 07:14:37 +01:00
|
|
|
- name: Configure Docker Nightly repo.
|
2017-05-10 04:36:53 +02:00
|
|
|
ini_file:
|
|
|
|
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
2020-12-27 07:14:37 +01:00
|
|
|
section: 'docker-{{ docker_edition }}-nightly'
|
2017-05-10 04:36:53 +02:00
|
|
|
option: enabled
|
2020-12-27 07:14:37 +01:00
|
|
|
value: '{{ docker_yum_repo_enable_nightly }}'
|
2020-08-20 19:37:17 +02:00
|
|
|
mode: 0644
|
2022-06-07 14:34:26 +02:00
|
|
|
no_extra_spaces: true
|
2022-12-14 16:31:46 +01:00
|
|
|
when: docker_add_repo | bool
|
2017-05-10 04:36:53 +02:00
|
|
|
|
|
|
|
- name: Configure Docker Test repo.
|
|
|
|
ini_file:
|
|
|
|
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
|
|
|
section: 'docker-{{ docker_edition }}-test'
|
|
|
|
option: enabled
|
|
|
|
value: '{{ docker_yum_repo_enable_test }}'
|
2020-08-20 19:37:17 +02:00
|
|
|
mode: 0644
|
2022-06-07 14:34:26 +02:00
|
|
|
no_extra_spaces: true
|
2022-12-14 16:31:46 +01:00
|
|
|
when: docker_add_repo | bool
|
2019-12-11 15:47:58 +01:00
|
|
|
|
2020-09-28 17:48:25 +02:00
|
|
|
- name: Configure containerd on RHEL 8.
|
2020-08-21 11:04:07 +02:00
|
|
|
block:
|
2023-09-25 20:59:01 +02:00
|
|
|
- name: Ensure runc is not installed.
|
|
|
|
package:
|
|
|
|
name: runc
|
|
|
|
state: absent
|
|
|
|
|
2020-09-28 17:48:25 +02:00
|
|
|
- name: Ensure container-selinux is installed.
|
2020-08-21 11:04:07 +02:00
|
|
|
package:
|
|
|
|
name: container-selinux
|
|
|
|
state: present
|
|
|
|
|
2020-09-28 17:48:25 +02:00
|
|
|
- name: Ensure containerd.io is installed.
|
2020-08-21 11:04:07 +02:00
|
|
|
package:
|
|
|
|
name: containerd.io
|
|
|
|
state: present
|
2023-09-07 13:15:06 +02:00
|
|
|
when: ansible_facts.distribution_major_version | int == 8
|