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
This commit is contained in:
Sorin Sbarnea 2020-02-21 16:35:53 +00:00
parent f607fd9a24
commit 299a654806
2 changed files with 18 additions and 22 deletions

View File

@ -1,8 +1,20 @@
--- ---
# package/dnf module do not support `--nobest` option which is needed for
- name: Install upstream docker # 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: package:
name: "{{ docker_upstream_distro_packages }}" name: "{{ docker_upstream_distro_packages }}"
state: present state: present
update_cache: yes update_cache: yes
notify: Restart docker 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

View File

@ -17,11 +17,9 @@
label: centos-7 label: centos-7
- job: - job:
name: zuul-jobs-test-install-docker-centos-8-nv name: zuul-jobs-test-install-docker-centos-8
description: Tests install-docker role on centos-8 description: Tests install-docker role on centos-8
parent: zuul-jobs-test-install-docker parent: zuul-jobs-test-install-docker
# TODO(ssbarnea): fix centos-8 in follow-up and remove nv
voting: false
nodeset: nodeset:
nodes: nodes:
- name: centos-8 - name: centos-8
@ -277,9 +275,9 @@
- project: - project:
check: check:
jobs: jobs: &id001
- zuul-jobs-test-install-docker-centos-7 - zuul-jobs-test-install-docker-centos-7
- zuul-jobs-test-install-docker-centos-8-nv - zuul-jobs-test-install-docker-centos-8
- zuul-jobs-test-install-docker-debian-stretch - zuul-jobs-test-install-docker-debian-stretch
- zuul-jobs-test-install-docker-fedora-30 - zuul-jobs-test-install-docker-fedora-30
- zuul-jobs-test-install-docker-ubuntu-bionic - zuul-jobs-test-install-docker-ubuntu-bionic
@ -294,18 +292,4 @@
- zuul-jobs-test-install-kubernetes-crio - zuul-jobs-test-install-kubernetes-crio
- zuul-jobs-test-install-podman - zuul-jobs-test-install-podman
gate: gate:
jobs: jobs: *id001
- zuul-jobs-test-install-docker-centos-7
- zuul-jobs-test-install-docker-debian-stretch
- zuul-jobs-test-install-docker-fedora-30
- zuul-jobs-test-install-docker-ubuntu-bionic
- zuul-jobs-test-install-docker-ubuntu-xenial
- zuul-jobs-test-registry-docker
- zuul-jobs-test-registry-podman
- zuul-jobs-test-registry-buildset-registry
- zuul-jobs-test-registry-buildset-registry-k8s-docker
- zuul-jobs-test-registry-buildset-registry-k8s-crio
- zuul-jobs-test-registry-buildset-registry-openshift-docker
- zuul-jobs-test-install-kubernetes-docker
- zuul-jobs-test-install-kubernetes-crio
- zuul-jobs-test-install-podman