Perform docker reconfiguration on upgrade_tasks.

The container-registry role is idempotent in a way that the
restarting of the docker service will be done only if some
configuration value has changed.
During the upgrade, host_prep_tasks are being run and if the
new templates bring some configuration change then the Docker
service gets restarted. The issue is the point at which they
get restarted, which is after the upgrade_tasks have already
run and prior to the deploy_tasks. This is causing issues with
Pacemaker handled resources.

For that reason, we include the very same task running in host_prep_tasks
into upgrade_tasks for the docker and docker-registry services,
forcing the Docker service reconfiguration to happen during
upgrade_tasks instead of at a latter point.

Closes-Bug: #1807418
Change-Id: I5e6ca987c01ff72a3c7e8900f9572024521164de
This commit is contained in:
Jose Luis Franco Arza 2018-12-05 15:09:07 +01:00
parent bf48c36bc4
commit 5bc5ae944a
2 changed files with 19 additions and 6 deletions

View File

@ -54,7 +54,7 @@ outputs:
- name: Install, Configure and Run Docker Distribution
block:
# NOTE(bogdando): w/a https://github.com/ansible/ansible/issues/42621
- set_fact:
- set_fact: &docker_vars
container_registry_host:
if:
- local_container_registry_is_empty
@ -65,6 +65,13 @@ outputs:
name: container-registry
tasks_from: docker-distribution
upgrade_tasks:
- name: Install docker packages on upgrade if missing
when: step|int == 3
package: name=docker-distribution state=latest
- block:
- name: Install docker packages on upgrade if missing
when: step|int == 3
package: name=docker-distribution state=latest
- set_fact: *docker_vars
- name: Reconfigure Docker if needed
include_role:
name: container-registry
tasks_from: docker
when: step|int = 3

View File

@ -120,9 +120,15 @@ outputs:
ovn_metadata:
docker_additional_sockets: {get_param: DockerAdditionalSockets}
upgrade_tasks:
- name: Install docker packages on upgrade if missing
- block:
- name: Install docker packages on upgrade if missing
package: name=docker state=latest
- set_fact: *docker_vars
- name: Reconfigure Docker if needed
include_role:
name: container-registry
tasks_from: docker
when: step|int == 3
package: name=docker state=latest
update_tasks:
- name: Restart Docker when needed
when: step|int == 2