Add DockerPuppetMountHostPuppet parameter

This can be used to control whether puppet modules are consumed
from the baremetal host or from the container. Our default
is to consume these from the host so that deployment
archive tarballs can be used to extra puppet modules from
the host.

Since I61e35d8118c1de4c2976f496e8a6c9c529f3d91f we've had
puppet-tripleo in our containers however so using this
location would be possible as well.

Change-Id: I73026e66bcfafd1c582916141b5b1cf0ce0dc36c
This commit is contained in:
Dan Prince 2018-03-08 09:13:42 -05:00
parent b6b4201be1
commit 0cbbdac604
4 changed files with 38 additions and 1 deletions

@ -409,6 +409,7 @@
CONFIG_VOLUME_PREFIX: '/var/lib/config-data{{ ansible_check_mode | ternary("/check-mode", "") }}'
CHECK_MODE: '{{ ansible_check_mode | ternary(1, 0) }}'
STARTUP_CONFIG_PATTERN: '/var/lib/tripleo-config/{{ ansible_check_mode | ternary("check-mode/", "") }}docker-container-startup-config-step_*.json'
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}'
when: step == "1"
changed_when: false
check_mode: no
@ -502,6 +503,7 @@
STEP: "{{ step }}"
CONTAINER_CLI: "{{ container_cli | default('docker') }}"
DEBUG: "{{ docker_puppet_debug|default(false) }}"
MOUNT_HOST_PUPPET: '{{docker_puppet_mount_host_puppet | default(true)}}'
when:
- deploy_server_id == bootstrap_server_id
- docker_puppet_tasks_json.stat.exists

@ -82,6 +82,10 @@ parameters:
description: CLI tool used to manage containers.
constraints:
- allowed_values: ['docker', 'podman']
DockerPuppetMountHostPuppet:
type: boolean
default: true
description: Whether containerized puppet executions use modules from the baremetal host. Defaults to true. Can be set to false to consume puppet modules from containers directly.
ctlplane_service_ips:
type: json
blacklisted_ip_addresses:
@ -131,6 +135,7 @@ resources:
- name: docker_puppet_debug
- name: container_cli
- name: docker_puppet_process_count
- name: docker_puppet_mount_host_puppet
- name: role_data_step_config
- name: role_data_puppet_config
type: Json
@ -375,6 +380,7 @@ resources:
docker_puppet_debug: {get_param: DockerPuppetDebug}
container_cli: {get_param: ContainerCli}
docker_puppet_process_count: {get_param: DockerPuppetProcessCount}
docker_puppet_mount_host_puppet: {get_param: DockerPuppetMountHostPuppet}
role_data_step_config: {get_param: [role_data, {{role.name}}, step_config]}
role_data_puppet_config: {get_param: [role_data, {{role.name}}, puppet_config]}
role_data_docker_config_scripts: {get_param: [role_data, {{role.name}}, docker_config_scripts]}
@ -436,6 +442,7 @@ outputs:
CONTAINER_CLI: {get_param: ContainerCli}
DOCKER_PUPPET_DEBUG: {get_param: DockerPuppetDebug}
DOCKER_PUPPET_PROCESS_COUNT: {get_param: DockerPuppetProcessCount}
DOCKER_PUPPET_MOUNT_HOST_PUPPET: {get_param: DockerPuppetMountHostPuppet}
template: |
- hosts: DEPLOY_SOURCE_HOST
name: Gather facts from undercloud
@ -481,6 +488,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
{%- for role in roles %}
- import_tasks: {{role.name}}/deploy_steps_tasks.yaml
@ -515,6 +523,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
{%- for role in roles %}
- import_tasks: {{role.name}}/host_prep_tasks.yaml
@ -540,6 +549,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- import_tasks: external_deploy_steps_tasks.yaml
tags:
@ -563,6 +573,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
{%- for role in roles %}
- import_tasks: {{role.name}}/deploy_steps_tasks.yaml
@ -586,6 +597,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- name: Check if /var/lib/docker-container-startup-configs.json already exists
stat:
@ -626,6 +638,7 @@ outputs:
container_cli: CONTAINER_CLI
docker_puppet_debug: DOCKER_PUPPET_DEBUG
docker_puppet_process_count: DOCKER_PUPPET_PROCESS_COUNT
docker_puppet_mount_host_puppet: DOCKER_PUPPET_MOUNT_HOST_PUPPET
tasks:
- import_tasks: external_post_deploy_steps_tasks.yaml
tags:

@ -83,6 +83,16 @@ else:
log.error('Invalid container_cli: %s' % container_cli)
sys.exit(1)
# Controls whether puppet is bind mounted in from the host
# NOTE: we require this to support the tarball extracted (Deployment archive)
# puppet modules but our containers now also include puppet-tripleo so we
# could use either
if os.environ.get('MOUNT_HOST_PUPPET', 'true') == 'true':
if container_cli == 'docker':
cli_dcmd.extend(['--volume', '/usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro,z'])
elif container_cli == 'podman':
cli_dcmd.extend(['--volume', '/usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro'])
# this is to match what we do in deployed-server
def short_hostname():

@ -49,6 +49,14 @@ parameters:
default: false
description: Remove package if the service is being disabled during upgrade
type: boolean
DockerPuppetMountHostPuppet:
type: boolean
default: true
description: Whether containerized puppet executions use modules from the baremetal host. Defaults to true. Can be set to false to consume puppet modules from containers directly.
conditions:
docker_puppet_mount_host: {equals: [{get_param: DockerPuppetMountHostPuppet}, true]}
resources:
@ -150,8 +158,12 @@ outputs:
- /lib/modules:/lib/modules:ro
- /run/openvswitch:/run/openvswitch:shared,z
- /etc/puppet:/etc/puppet:ro
- /usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro
- /var/run/openvswitch/:/var/run/openvswitch/:shared,z
-
if:
- docker_puppet_mount_host
- /usr/share/openstack-puppet/modules/:/usr/share/openstack-puppet/modules/:ro
- ''
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
step_4: