Add EnablePuppet (defaults to true)

This wires in a heat parameter that can be used to disable the
baremetal (Puppet) deployment tasks. Useful for testing
some lightweight/containers only deployments.

Change-Id: I376418c618616b7755fafefa80fea8150cf16b99
This commit is contained in:
Dan Prince 2018-03-06 13:43:07 -05:00
parent 4c58be93a7
commit cb16252474
2 changed files with 13 additions and 2 deletions

View File

@ -134,11 +134,14 @@
- name: Set host puppet debugging fact string
set_fact:
host_puppet_config_debug: "--debug --verbose"
when: enable_debug|default(false)|bool
when:
- enable_puppet|default(true)|bool
- enable_debug|default(false)|bool
- name: Write the config_step hieradata
copy: content="{{dict(step=step|int)|to_json}}" dest=/etc/puppet/hieradata/config_step.json force=true mode=0600
become: true
- name: Run puppet host configuration for step {{step}}
when: enable_puppet|default(true)|bool
command: >-
puppet apply {{ host_puppet_config_debug|default('') }}
--modulepath=/etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules
@ -154,7 +157,9 @@
become: true
- name: "Debug output for task which failed: Run puppet host configuration for step {{step}}"
debug: var=outputs.stdout_lines|default([])|union(outputs.stderr_lines|default([]))
when: outputs.rc is defined
when:
- enable_puppet|default(true)|bool
- outputs.rc is defined
failed_when: outputs.rc not in [0, 2]
######################################
# Generate config via docker-puppet.py

View File

@ -55,6 +55,10 @@ parameters:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
EnablePuppet:
default: true
description: Whether to run the puppet (baremetal) deployment tasks.
type: boolean
DockerPuppetDebug:
type: string
default: ''
@ -105,6 +109,7 @@ resources:
- name: update_identifier
- name: bootstrap_server_id
- name: enable_debug
- name: enable_puppet
- name: docker_puppet_debug
- name: docker_puppet_process_count
- name: role_data_step_config
@ -323,6 +328,7 @@ resources:
update_identifier: {get_param: DeployIdentifier}
bootstrap_server_id: {get_attr: [BootstrapServerId, value]}
enable_debug: {get_param: ConfigDebug}
enable_puppet: {get_param: EnablePuppet}
docker_puppet_debug: {get_param: DockerPuppetDebug}
docker_puppet_process_count: {get_param: DockerPuppetProcessCount}
role_data_step_config: {get_param: [role_data, {{role.name}}, step_config]}