ansible-role-docker/tasks/el_pkgs.yml

25 lines
676 B
YAML
Raw Normal View History

2020-08-11 20:01:36 +02:00
---
- block:
- name: Add the Docker repository to EL
get_url: url='{{ docker_el_repo }}' dest=/etc/yum.repos.d/docker-ce.repo
- name: Install Docker
yum: pkg={{ docker_el_packages }} state={{ docker_pkg_status }}
when: docker_install | bool
tags: docker
- block:
- name: Ensure that the service is stopped and disabled
service: name=docker state=stopped enabled=no
ignore_errors: True
- name: Remove the Docker package
yum: pkg={{ docker_el_packages }} state=absent
- name: Remove the Docker repository
file: dest=/etc/yum.repos.d/docker-ce.repo state=absent
when: not docker_install | bool
tags: docker