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