Rename docker_puppet_tasks to container_puppet_tasks

Change-Id: I23c539555fe1f9db96cd9b84fdcb4240473d55df
This commit is contained in:
Emilien Macchi 2019-03-01 14:33:07 -05:00
parent 17d1ed8d56
commit 3e62d483fc
13 changed files with 41 additions and 20 deletions

View File

@ -514,32 +514,32 @@
# Bootstrap tasks - run any tasks that have been defined
########################################################
- name: "Clean docker_puppet_tasks for {{ansible_hostname}} step {{step}}"
- name: "Clean container_puppet_tasks for {{ansible_hostname}} step {{step}}"
file:
path: /var/lib/container-puppet/container-puppet-tasks{{step}}.json
state: absent
tags:
- container_config_tasks
- name: Calculate docker_puppet_tasks for {{ansible_hostname}} step {{step}}
- name: Calculate container_puppet_tasks for {{ansible_hostname}} step {{step}}
set_fact:
host_docker_puppet_tasks: "{{host_docker_puppet_tasks|default([]) + [item]}}"
loop: "{{docker_puppet_tasks.get('step_' + step, [])}}"
host_container_puppet_tasks: "{{host_container_puppet_tasks|default([]) + [item]}}"
loop: "{{container_puppet_tasks.get('step_' + step, [])}}"
when: vars[item.service_name + '_short_bootstrap_node_name'] == ansible_hostname
vars:
docker_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/docker_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
container_puppet_tasks: "{{ lookup('file', tripleo_role_name + '/container_puppet_tasks.yaml', errors='ignore') | default({}, True) | from_yaml }}"
tags:
- container_config_tasks
- name: Write container-puppet-tasks json file for {{ansible_hostname}} step {{step}}
copy:
content: "{{host_docker_puppet_tasks|to_nice_json}}"
content: "{{host_container_puppet_tasks|to_nice_json}}"
dest: "/var/lib/container-puppet/container-puppet-tasks{{step}}.json"
force: yes
mode: '0600'
tags:
- container_config_tasks
when: host_docker_puppet_tasks is defined
when: host_container_puppet_tasks is defined
- name: Run container-puppet tasks (bootstrap tasks) for step {{ step }}
shell: "{{ python_cmd }} /var/lib/container-puppet/container-puppet.py"
@ -552,7 +552,7 @@
CONTAINER_CLI: "{{ container_cli }}"
DEBUG: "{{ docker_puppet_debug }}"
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet}}'
when: host_docker_puppet_tasks is defined
when: host_container_puppet_tasks is defined
changed_when: false
register: outputs
failed_when: false

View File

@ -289,6 +289,7 @@ resources:
expression: coalesce($.data.role_data, []).where($ != null).select($.get('kolla_config')).where($ != null).reduce($1.mergeWith($2), {})
data: {role_data: {get_attr: [ServiceChain, role_data]}}
# DEPRECATED in favor of ContainerPuppetTasks.
DockerPuppetTasks:
type: OS::Heat::Value
properties:
@ -301,6 +302,18 @@ resources:
expression: dict(coalesce($.data, []).where($ != null).select([$.get('docker_puppet_tasks'), $.get('service_name')]).where($[0] != null).select([$[0], dict($[0].keys().zip(dict(service_name=>$[1]).repeat(len($[0].keys()))))]).select($[0].mergeWith($[1])).selectMany($.items()).groupBy($[0], $[1]))
data: {get_attr: [ServiceChain, role_data]}
ContainerPuppetTasks:
type: OS::Heat::Value
properties:
type: json
value:
yaql:
# This extracts container_puppet_tasks for each step,
# and merges {service_name: the_service} for each item, so we
# can later filter based on the bootstrap hostname for the service
expression: dict(coalesce($.data, []).where($ != null).select([$.get('container_puppet_tasks'), $.get('service_name')]).where($[0] != null).select([$[0], dict($[0].keys().zip(dict(service_name=>$[1]).repeat(len($[0].keys()))))]).select($[0].mergeWith($[1])).selectMany($.items()).groupBy($[0], $[1]))
data: {get_attr: [ServiceChain, role_data]}
HostPrepTasks:
type: OS::Heat::Value
properties:
@ -356,5 +369,8 @@ outputs:
kolla_config: {get_attr: [KollaConfig, value]}
docker_config: {get_attr: [DockerConfig, value]}
docker_config_scripts: {get_attr: [DockerConfigScripts, value]}
docker_puppet_tasks: {get_attr: [DockerPuppetTasks, value]}
container_puppet_tasks:
map_merge:
- {get_attr: [ContainerPuppetTasks, value]}
- {get_attr: [DockerPuppetTasks, value]}
host_prep_tasks: {get_attr: [HostPrepTasks, value]}

View File

@ -324,7 +324,7 @@ outputs:
- /var/log/containers/httpd/cinder-api:/var/log/httpd:z
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
container_puppet_tasks:
# Create the default volume type after the cinder-api service is
# running. The puppet code will ensure this is only done once, on
# the bootstrap node.

View File

@ -210,7 +210,7 @@ outputs:
user: root
command:
[ 'mysql', '/bin/bash', '-c', 'cp /var/lib/kolla/config_files/src/root/.my.cnf /root' ]
docker_puppet_tasks:
container_puppet_tasks:
# MySQL database initialization occurs only on single node
step_2:
config_volume: 'mysql_init_tasks'

View File

@ -141,7 +141,7 @@ outputs:
- /var/lib/config-data/puppet-generated/etcd/:/var/lib/kolla/config_files/src:ro
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
container_puppet_tasks:
# Etcd keys initialization occurs only on single node
step_2:
config_volume: 'etcd_init_tasks'

View File

@ -792,7 +792,7 @@ outputs:
user: root
command:
[ 'keystone', 'pkill', '--signal', 'USR1', 'httpd' ]
docker_puppet_tasks:
container_puppet_tasks:
# Keystone endpoint creation occurs only on single node
step_3:
config_volume: 'keystone_init_tasks'

View File

@ -221,7 +221,7 @@ outputs:
dest: "/"
merge: true
preserve_properties: true
docker_puppet_tasks:
container_puppet_tasks:
step_5:
config_volume: octavia
puppet_tags: nova_flavor

View File

@ -322,7 +322,7 @@ outputs:
- null
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
container_puppet_tasks:
# RabbitMQ users and policies initialization occurs only on single node
step_2:
config_volume: 'rabbit_init_tasks'

View File

@ -270,7 +270,7 @@ outputs:
- null
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
container_puppet_tasks:
# RabbitMQ users and policies initialization occurs only on single node
step_2:
config_volume: 'rabbit_init_tasks'

View File

@ -270,7 +270,7 @@ outputs:
- null
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
docker_puppet_tasks:
container_puppet_tasks:
# RabbitMQ users and policies initialization occurs only on single node
step_2:
config_volume: 'rabbit_init_tasks'

View File

@ -90,8 +90,8 @@ are re-asserted when applying latter ones.
used along with this manifest to generate a config directory for
this container.
* docker_puppet_tasks: This section provides data to drive the
container-puppet.py tool directly. The task is executed only once
* container_puppet_tasks: This section provides data to drive the
docker-puppet.py tool directly. The task is executed only once
within the cluster (not on each node) and is useful for several
puppet snippets we require for initialization of things like
keystone endpoints, database users, etc. See container-puppet.py

View File

@ -0,0 +1,5 @@
---
deprecations:
- |
docker_puppet_tasks is deprecated in favor of container_puppet_tasks.
docker_puppet_tasks is still working in Stein but will be removed in Train.

View File

@ -55,7 +55,7 @@ ENDPOINT_MAP_FILE = 'endpoint_map.yaml'
OPTIONAL_SECTIONS = ['cellv2_discovery']
REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config',
'config_settings']
OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
OPTIONAL_DOCKER_SECTIONS = ['container_puppet_tasks', 'upgrade_tasks',
'deploy_steps_tasks',
'pre_upgrade_rolling_tasks',
'fast_forward_upgrade_tasks',