zuul-jobs/roles/ensure-docker/tasks/upstream-package-installation.yaml
vass c80b593fb6 Rename install-docker to ensure-docker for consistency
The old role will be kept and include ensure-docker for backwards compatability.

Change-Id: Icb76a954b04631c405b09eb54343fd852a511b83
2020-04-04 15:41:29 -04:00

27 lines
870 B
YAML

---
- name: Remove packages
package:
name: "{{ docker_upstream_distro_remove_packages }}"
state: absent
when: docker_upstream_distro_remove_packages
# package/dnf module do not support `--nobest` option which is needed for
# installing docker-ce on centos-8
- name: Install upstream docker using package
when: not (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8')
package:
name: "{{ docker_upstream_distro_packages }}"
state: present
update_cache: yes
notify: Restart docker
- name: Install upstream docker using shell
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8'
shell:
cmd: |
dnf install --nobest -y {{ docker_upstream_distro_packages | join(' ') }}
warn: false
register: result
changed_when: "'Complete!' in result.stdout"
notify: Restart docker