Merge "Add EnablePuppet (defaults to true)"

This commit is contained in:
Zuul 2018-03-23 09:44:59 +00:00 committed by Gerrit Code Review
commit 86204c805c
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

@ -57,6 +57,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: ''
@ -107,6 +111,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
@ -325,6 +330,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]}