Merge "Cleanup tasks for container-puppet.py" into stable/train

This commit is contained in:
Zuul 2020-03-10 03:05:54 +00:00 committed by Gerrit Code Review
commit b3d9c160d7
6 changed files with 27 additions and 15 deletions

View File

@ -9,9 +9,18 @@
- name: Create /var/lib/container-puppet
no_log: True
file: path=/var/lib/container-puppet state=directory setype=container_file_t selevel=s0 recurse=true
- name: Write container-puppet.py
- name: Write container-puppet.py if Paunch is enabled
no_log: True
copy: src=docker_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.py force=yes mode=0600
when:
- enable_paunch|default(false)
- name: Remove container-puppet.py if Paunch is disabled
no_log: True
file:
path: /var/lib/container-puppet/container-puppet.py
state: absent
when:
- not enable_paunch|default(false)
- name: Write container-puppet.sh
no_log: True
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t

View File

@ -97,7 +97,7 @@
tags:
- host_config
# Config file for our container-puppet.py script, used to generate container configs
# Puppet Containers Config directory used to generate container configs
- name: Create /var/lib/container-puppet
file:
path: /var/lib/container-puppet

View File

@ -61,9 +61,9 @@
tags:
- host_config
#########################################
# Pre-cache facts for container-puppet.py
#########################################
#######################################
# Pre-cache facts for puppet containers
#######################################
# We don't want the pre-cache tasks to be skipped in dry-run so we force
# check_mode to "no".
# https://bugzilla.redhat.com/show_bug.cgi?id=1738529
@ -135,9 +135,9 @@
delegate_to: "{{ inventory_hostname }}"
when: _facter_cache_run is succeeded
######################################
# Generate config via container-puppet.py
######################################
#######################################
# Generate config via puppet containers
#######################################
- name: Include container-puppet tasks (generate config) during step 1
include_tasks: generate-config-tasks.yaml

View File

@ -73,7 +73,7 @@ parameters:
DockerPuppetDebug:
type: boolean
default: false
description: Set to True to enable debug logging with container-puppet.py
description: Set to True to enable debug logging with Puppet Containers
DockerPuppetProcessCount:
type: number
default: 6
@ -1593,9 +1593,11 @@ outputs:
{%- endfor %}
- name: Create /var/lib/container-puppet
file: path=/var/lib/container-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
- name: Write container-puppet.py
- name: Write container-puppet.py if Paunch is enabled
no_log: True
copy: src=docker_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.py force=yes mode=0600
when:
- enable_paunch|default(false)
- name: Write container-puppet.sh
no_log: True
copy: src=container_puppet_script.yaml dest=/var/lib/container-puppet/container-puppet.sh force=yes mode=0755 setype=container_file_t

View File

@ -80,7 +80,7 @@
# numbers are failures
tripleo_container_manage_valid_exit_code: [0, 2]
- name: Diff container-puppet.py puppet-generated changes for check mode
- name: Diff puppet-generated changes for check mode
shell: |
diff -ruN --no-dereference -q /var/lib/config-data/puppet-generated /var/lib/config-data/check-mode/puppet-generated
diff -ruN --no-dereference /var/lib/config-data/puppet-generated /var/lib/config-data/check-mode/puppet-generated
@ -94,7 +94,7 @@
failed_when: false
changed_when: diff_results.rc == 1
- name: Diff container-puppet.py puppet-generated changes for check mode
- name: Diff puppet-generated changes for check mode
debug:
var: diff_results.stdout_lines
changed_when: diff_results.rc == 1

View File

@ -67,7 +67,8 @@ are available for containerized services.
* config_settings: This section contains service specific hiera data
can be used to generate config files for each service. This data
is ultimately processed via the container-puppet.py tool which
is ultimately processed via the container-puppet.py tool (in new versions
it's handled by the container_puppet_config module in tripleo-ansible) which
generates config files for each service according to the settings here.
* kolla_config: Contains YAML that represents how to map config files
@ -107,10 +108,10 @@ are available for containerized services.
this container.
* container_puppet_tasks: This section provides data to drive the
container-puppet.py tool directly. The task is executed for the
puppet containers tooling directly. The task is executed for the
defined steps before the corresponding docker_config's step. Puppet
always sees the step number overrided as the step #6. It might be useful
for initialization of things. See container-puppet.py for formatting.
for initialization of things.
Note that the tasks are executed only once for the bootstrap node per a
role in the cluster. Make sure the puppet manifest ensures the wanted
"at most once" semantics. That may be achieved via the