xoxys.docker_engine/tasks/install.yml
Robert Kaussow d970df11b3
Some checks failed
continuous-integration/drone/pr Build is failing
add task to remove old packages
2023-02-13 21:37:56 +01:00

48 lines
1.2 KiB
YAML

---
- block:
- 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"
- name: Install dependencies
package:
name: "{{ item }}"
state: present
loop: "{{ dockerengine_packages_extra }}"
- name: Install python dependencies
pip:
name: "{{ item }}"
virtualenv: /opt/python2/ansible-deps
loop: "{{ __docker_ansible_deps }}"
- name: Add docker-compose wrapper
template:
src: bin/docker-compose.j2
dest: /usr/local/bin/docker-compose
owner: root
group: root
mode: 0755
- name: Ensure to remove old docker packages
package:
name:
- docker
- docker-common
- docker-engine
state: absent
- name: Install packages
package:
name: "{{ item }}"
state: present
loop: "{{ dockerengine_packages }}"
become: True
become_user: root