From e77de0d5ff7491d065193f898d1a027b5386312d Mon Sep 17 00:00:00 2001 From: Steven Hardy Date: Fri, 19 May 2017 16:38:56 +0100 Subject: Write md5sum for service config directories The configuration generated by docker-puppet may change on update, so checksum the combined files from the config-data directories, to enable detecting those that have changed and restarting the appropriate containers - we need to merge this checksum into the environment passed to the containters, as this will cause paunch to correctly restart containers when the configuration generated changes, even if the rest of the json definition provided by heat does not. Change-Id: I40d9080cf3ad708ef4ed91e46d2b2ae1138bb9c3 --- docker/deploy-steps-playbook.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'docker/deploy-steps-playbook.yaml') diff --git a/docker/deploy-steps-playbook.yaml b/docker/deploy-steps-playbook.yaml index a0beaa2c..b3cb500f 100644 --- a/docker/deploy-steps-playbook.yaml +++ b/docker/deploy-steps-playbook.yaml @@ -23,12 +23,15 @@ ################################################## # Per step starting of the containers using paunch ################################################## - - name: Check if /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json exists + - name: Check if /var/lib/hashed-tripleo-config/docker-container-startup-config-step_{{step}}.json exists stat: - path: /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json + path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json register: docker_config_json + # Note docker-puppet.py generates the hashed-*.json file, which is a copy of + # the *step_n.json with a hash of the generated external config added + # This acts as a salt to enable restarting the container if config changes - name: Start containers for step {{step}} - command: paunch --debug apply --file /var/lib/tripleo-config/docker-container-startup-config-step_{{step}}.json --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}} + command: paunch --debug apply --file /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json --config-id tripleo_step{{step}} --managed-by tripleo-{{role_name}} when: docker_config_json.stat.exists changed_when: false check_mode: no -- cgit 1.2.3-korg