Merge "Default empty map for docker_config steps"

This commit is contained in:
Zuul 2018-01-17 19:04:22 +00:00 committed by Gerrit Code Review
commit d5ddb1d860
2 changed files with 10 additions and 8 deletions

View File

@ -50,11 +50,6 @@
##################################################
# Per step starting of the containers using paunch
##################################################
- name: Check if /var/lib/hashed-tripleo-config/docker-container-startup-config-step_{{step}}.json exists
stat:
path: /var/lib/tripleo-config/hashed-docker-container-startup-config-step_{{step}}.json
register: docker_config_json
become: true
# 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
@ -63,7 +58,6 @@
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
register: outputs

View File

@ -245,6 +245,7 @@ resources:
bootstrap_server_id: {get_attr: [BootstrapServerId, value]}
puppet_step_config: {get_param: [role_data, {{role.name}}, step_config]}
docker_config_scripts: {get_param: [role_data, {{role.name}}, docker_config_scripts]}
deploy_steps_max: {{deploy_steps_max}}
tasks:
# Join host_prep_tasks with the other per-host configuration
list_concat:
@ -277,11 +278,18 @@ resources:
# and docker-cmd. This lets us create command line tools to test containers.
# FIXME do we need the docker-container-startup-configs.json or is the new per-step
# data consumed by paunch enough?
- name: Set docker_startup_configs_default fact
set_fact:
docker_startup_configs_default: "{{ '{{' }}docker_startup_configs_default|default({}) | combine( {'step_'+item: {}} ) {{ '}}'}}"
with_sequence: count="{{ '{{' }}deploy_steps_max{{ '}}' }}"
- name: Set docker_startup_configs_with_default fact
set_fact:
docker_startup_configs_with_default: "{{ '{{' }} docker_startup_configs_default | combine(docker_startup_configs) {{ '}}'}}"
- name: Write docker-container-startup-configs
copy: content="{{ '{{' }}docker_startup_configs | to_json{{ '}}' }}" dest=/var/lib/docker-container-startup-configs.json force=yes mode=0600
copy: content="{{ '{{' }} docker_startup_configs_with_default | to_json{{ '}}' }}" dest=/var/lib/docker-container-startup-configs.json force=yes mode=0600
- name: Write per-step docker-container-startup-configs
copy: content="{{ '{{' }}item.value|to_json{{ '}}' }}" dest="/var/lib/tripleo-config/docker-container-startup-config-{{ '{{' }}item.key{{ '}}' }}.json" force=yes mode=0600
with_dict: "{{ '{{' }}docker_startup_configs{{ '}}' }}"
with_dict: "{{ '{{' }} docker_startup_configs_with_default {{ '}}' }}"
- name: Create /var/lib/kolla/config_files directory
file: path=/var/lib/kolla/config_files state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
- name: Write kolla config json files