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

44 lines
1.1 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
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
- name: Configure Docker Edge repo.
ini_file:
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
section: 'docker-{{ docker_edition }}-edge'
option: enabled
value: '{{ docker_yum_repo_enable_edge }}'
2020-08-20 20:37:17 +03:00
mode: 0644
- 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
- name: Install containerd separately (CentOS 8).
package:
2020-05-20 06:26:37 +03:00
name: https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.13-3.2.el7.x86_64.rpm
state: present
when: ansible_distribution_major_version | int == 8