xoxys.docker_engine/tasks/install.yml

48 lines
1.2 KiB
YAML
Raw Permalink Normal View History

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 }}"
virtualenv: /opt/python2/ansible-deps
loop: "{{ dockerengine_ansible_deps }}"
2020-06-14 17:28:34 +00:00
- name: Add docker-compose wrapper
template:
src: bin/docker-compose.j2
dest: /usr/local/bin/docker-compose
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