Browse Source

Merge "Generate container startup configs with a new module" into stable/ussuri

tags/12.4.0
Zuul 2 weeks ago
committed by Gerrit Code Review
parent
commit
6ee3e2f111
3 changed files with 3 additions and 50 deletions
  1. +0
    -26
      common/container_startup_configs_tasks.yaml
  2. +3
    -23
      common/deploy-steps-tasks-step-1.yaml
  3. +0
    -1
      common/deploy-steps.j2

+ 0
- 26
common/container_startup_configs_tasks.yaml View File

@@ -1,26 +0,0 @@
---

# TODO(emilien) convert this whole task in a module
# https://bugs.launchpad.net/tripleo/+bug/1884577
- name: "Remove old {{ item.0 }} container startup configs"
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}"
state: absent

- name: "Create directory for {{ item.0 }} container startup configs"
file:
path: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/"
mode: 0600
recurse: yes
setype: container_file_t

- name: "Creating container startup configs for {{ item.0 }}"
copy:
content: "{{ startup_data.value | to_nice_json }}"
dest: "/var/lib/tripleo-config/container-startup-config/{{ item.0 }}/{{ startup_data.key }}.json"
setype: container_file_t
mode: 0600
no_log: true
loop_control:
loop_var: startup_data
loop: "{{ item.1 | dict2items }}"

+ 3
- 23
common/deploy-steps-tasks-step-1.yaml View File

@@ -208,26 +208,6 @@
tags:
- container_config_scripts

# Here we are dumping all the container startup configuration data
# so that we can have access to how they are started outside of heat
# and container cmd. This lets us create command line tools to test containers.
- name: Set container_config_default fact
no_log: True
set_fact:
container_config_default: "{{ container_config_default | default({}) | combine( {'step_' + item: {}} ) }}"
with_sequence: count={{ deploy_steps_max }}
tags:
- container_startup_configs

- name: Set container_startup_configs_with_default fact
no_log: True
set_fact:
container_config_with_default: "{{ container_config_default | combine(role_data_container_config) }}"
vars:
role_data_container_config: "{{ lookup('file', tripleo_role_name + '/docker_config.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags:
- container_startup_configs

# This file location is deprecated and the new location is now:
# /var/lib/tripleo-config/container-startup-config/step_X/<container_name>.json
# Can be removed in V cycle
@@ -242,9 +222,9 @@
- container_startup_configs

- name: Generate startup configs files per step and per container
no_log: True
include_tasks: container_startup_configs_tasks.yaml
loop: "{{ container_config_with_default | dictsort }}"
container_startup_config:
config_base_dir: /var/lib/tripleo-config/container-startup-config
config_data: "{{ lookup('file', (tripleo_role_name + '/docker_config.yaml'), errors='ignore') | default({}, True) | from_yaml }}"
tags:
- container_startup_configs



+ 0
- 1
common/deploy-steps.j2 View File

@@ -406,7 +406,6 @@ outputs:
hiera_steps_tasks: {get_file: hiera-steps-tasks.yaml}
deploy_steps_tasks_step_0: {get_file: deploy-steps-tasks-step-0.yaml}
common_deploy_steps_tasks_step_1: {get_file: deploy-steps-tasks-step-1.yaml}
container_startup_configs_tasks: {get_file: container_startup_configs_tasks.yaml}
docker_puppet_script: {get_file: ./container-puppet.py}
container_puppet_script: {get_file: ./container-puppet.sh}
all_nodes_validation_script.sh : {get_file: ../validation-scripts/all-nodes.sh}


Loading…
Cancel
Save