From e3a0867b67b3f83e1077f112f07ecbaf8236e173 Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Wed, 22 Nov 2017 16:36:14 +0100 Subject: With dnf repoquery and excluded packages, --disableexcludes=all is needed to list the package with --installed. --- playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml | 2 +- playbooks/init/facts.yml | 1 + roles/docker/tasks/package_docker.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml index 52345a9ba..2e3a7ae8b 100644 --- a/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml +++ b/playbooks/common/openshift-cluster/upgrades/docker/upgrade_check.yml @@ -16,7 +16,7 @@ changed_when: no - name: Get current version of Docker - command: "{{ repoquery_cmd }} --installed --qf '%{version}' docker" + command: "{{ repoquery_installed }} --qf '%{version}' docker" register: curr_docker_version retries: 4 until: curr_docker_version | succeeded diff --git a/playbooks/init/facts.yml b/playbooks/init/facts.yml index c9a3448c7..9fb4ad951 100644 --- a/playbooks/init/facts.yml +++ b/playbooks/init/facts.yml @@ -154,6 +154,7 @@ - name: initialize_facts set_fact repoquery command set_fact: repoquery_cmd: "{{ 'dnf repoquery --latest-limit 1 -d 0' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins' }}" + repoquery_installed: "{{ 'dnf repoquery --latest-limit 1 -d 0 --disableexcludes=all --installed' if ansible_pkg_mgr == 'dnf' else 'repoquery --plugins --installed' }}" - name: initialize_facts set_fact on openshift_docker_hosted_registry_network set_fact: diff --git a/roles/docker/tasks/package_docker.yml b/roles/docker/tasks/package_docker.yml index e6c3fe4d7..06ba36d59 100644 --- a/roles/docker/tasks/package_docker.yml +++ b/roles/docker/tasks/package_docker.yml @@ -1,6 +1,6 @@ --- - name: Get current installed Docker version - command: "{{ repoquery_cmd }} --installed --qf '%{version}' docker" + command: "{{ repoquery_installed }} --qf '%{version}' docker" when: not openshift.common.is_atomic | bool register: curr_docker_version retries: 4 -- cgit v1.2.3 From e4db872a66bdb41f6c45b7a3235d09a439c08936 Mon Sep 17 00:00:00 2001 From: Jan Pazdziora Date: Wed, 22 Nov 2017 16:37:43 +0100 Subject: Workaround the fact that package state=present with dnf fails for already installed but excluded packages. --- roles/docker/tasks/package_docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/docker/tasks/package_docker.yml b/roles/docker/tasks/package_docker.yml index 06ba36d59..5437275a2 100644 --- a/roles/docker/tasks/package_docker.yml +++ b/roles/docker/tasks/package_docker.yml @@ -33,9 +33,10 @@ # Make sure Docker is installed, but does not update a running version. # Docker upgrades are handled by a separate playbook. +# Note: The curr_docker_version.stdout check can be removed when https://github.com/ansible/ansible/issues/33187 gets fixed. - name: Install Docker package: name=docker{{ '-' + docker_version if docker_version is defined else '' }} state=present - when: not openshift.common.is_atomic | bool + when: not openshift.common.is_atomic | bool and not curr_docker_version | skipped and not curr_docker_version.stdout != '' - block: # Extend the default Docker service unit file when using iptables-services -- cgit v1.2.3