From 299a654806555239f80daceadda5a0fa4cb7a104 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 21 Feb 2020 16:35:53 +0000 Subject: [PATCH] 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 --- .../tasks/upstream-package-installation.yaml | 16 +++++++++++-- zuul-tests.d/container-roles-jobs.yaml | 24 ++++--------------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/roles/install-docker/tasks/upstream-package-installation.yaml b/roles/install-docker/tasks/upstream-package-installation.yaml index 9e52e2ccf..0f22d1e10 100644 --- a/roles/install-docker/tasks/upstream-package-installation.yaml +++ b/roles/install-docker/tasks/upstream-package-installation.yaml @@ -1,8 +1,20 @@ --- - -- name: Install upstream docker +# 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 diff --git a/zuul-tests.d/container-roles-jobs.yaml b/zuul-tests.d/container-roles-jobs.yaml index 66c4d7ee4..2c547dc32 100644 --- a/zuul-tests.d/container-roles-jobs.yaml +++ b/zuul-tests.d/container-roles-jobs.yaml @@ -17,11 +17,9 @@ label: centos-7 - 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 parent: zuul-jobs-test-install-docker - # TODO(ssbarnea): fix centos-8 in follow-up and remove nv - voting: false nodeset: nodes: - name: centos-8 @@ -277,9 +275,9 @@ - project: check: - jobs: + jobs: &id001 - 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-fedora-30 - zuul-jobs-test-install-docker-ubuntu-bionic @@ -294,18 +292,4 @@ - zuul-jobs-test-install-kubernetes-crio - zuul-jobs-test-install-podman gate: - jobs: - - 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 + jobs: *id001