ansible-role-docker/tasks/setup-RedHat.yml

57 lines
1.4 KiB
YAML
Raw Normal View History

2017-02-24 07:08:18 +03:00
---
- name: Ensure old versions of Docker are not installed.
package:
name:
- docker
- docker-common
- docker-engine
state: absent
- name: Add Docker GPG key.
rpm_key:
2019-03-19 21:33:20 +03:00
key: "{{ docker_yum_gpg_key }}"
state: present
when: docker_add_repo | bool
2017-02-24 07:08:18 +03:00
- name: Add Docker repository.
get_url:
url: "{{ docker_yum_repo_url }}"
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
owner: root
group: root
mode: 0644
when: docker_add_repo | bool
- name: Configure Docker Nightly repo.
ini_file:
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
section: 'docker-{{ docker_edition }}-nightly'
option: enabled
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
when: docker_add_repo | bool
- 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
when: docker_add_repo | bool
2020-09-28 18:48:25 +03:00
- name: Configure containerd on RHEL 8.
2020-08-21 12:04:07 +03:00
block:
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
when: ansible_distribution_major_version | int == 8