zuul-jobs/roles/install-docker/tasks/upstream-package-installation.yaml
Sorin Sbarnea 299a654806 Fix install-docker on centos-8
Implements workaround for the missing --nobest option in Ansible
package module in order to succeed installing docker-ce.

Change-Id: I96e133dc5c59b9c811ff69df7651adadfcdf3a97
2020-02-25 10:56:37 +00:00

21 lines
712 B
YAML

---
# 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