2019-11-24 16:21:18 +00:00
|
|
|
---
|
2020-06-14 17:28:34 +00:00
|
|
|
- block:
|
2023-02-18 14:14:39 +00:00
|
|
|
- name: Add Docker CE repository
|
|
|
|
yum_repository:
|
|
|
|
name: "docker-ce"
|
|
|
|
file: "Docker-CE"
|
|
|
|
description: "Docker CE Stable"
|
|
|
|
baseurl: "https://download.docker.com/linux/centos/{{ ansible_distribution_major_version }}/{{ ansible_architecture }}/stable"
|
|
|
|
gpgcheck: yes
|
|
|
|
enabled: yes
|
|
|
|
gpgkey: "https://download.docker.com/linux/rhel/gpg"
|
|
|
|
|
2019-11-24 16:21:18 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
package:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: present
|
|
|
|
loop: "{{ dockerengine_packages_extra }}"
|
|
|
|
|
2020-06-14 17:28:34 +00:00
|
|
|
- name: Install python dependencies
|
|
|
|
pip:
|
|
|
|
name: "{{ item }}"
|
2020-06-23 07:48:27 +00:00
|
|
|
virtualenv: /opt/python2/ansible-deps
|
2023-06-05 20:55:25 +00:00
|
|
|
loop: "{{ dockerengine_ansible_deps }}"
|
2020-06-14 17:28:34 +00:00
|
|
|
|
2020-06-23 07:48:27 +00:00
|
|
|
- name: Add docker-compose wrapper
|
|
|
|
template:
|
|
|
|
src: bin/docker-compose.j2
|
2020-06-29 07:04:49 +00:00
|
|
|
dest: /usr/local/bin/docker-compose
|
2020-06-23 07:48:27 +00:00
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0755
|
|
|
|
|
2023-02-18 14:14:39 +00:00
|
|
|
- name: Ensure to remove old docker packages
|
|
|
|
package:
|
|
|
|
name:
|
|
|
|
- docker
|
|
|
|
- docker-common
|
|
|
|
- docker-engine
|
|
|
|
state: absent
|
|
|
|
|
2019-11-24 16:21:18 +00:00
|
|
|
- name: Install packages
|
|
|
|
package:
|
2019-11-24 22:11:02 +00:00
|
|
|
name: "{{ item }}"
|
2019-11-24 16:21:18 +00:00
|
|
|
state: present
|
2020-06-14 17:28:34 +00:00
|
|
|
loop: "{{ dockerengine_packages }}"
|
2019-11-24 16:21:18 +00:00
|
|
|
become: True
|
|
|
|
become_user: root
|