Add proper debug switch on init_bundles

When deploying with -e environments/config-debug.yaml, which sets
ConfigDebug to true, it is expected that puppet is run with --debug
--verbose. This has happened for most of the puppet uses (via
LP#1722752), but we missed enabling it for the init_bundle under
docker/services.

While we're at it we also add '--color=false' to the puppet apply
command of the init_bundle containers as that is what we use in the
other puppet apply runs.

NB: Cherry-pick not 100% clean on docker/services/haproxy.yaml due to
    the logging to stdou/stderr changes

Closes-Bug: #1738764

Change-Id: If529b83a7342b3ad17d705517978539d1c6b949e
(cherry picked from commit 4d7e03be85)
This commit is contained in:
Michele Baldessari 2017-12-17 20:03:02 +01:00
parent f819cc13ca
commit f16c421ce1
9 changed files with 112 additions and 11 deletions

View File

@ -68,9 +68,13 @@ parameters:
type: string
description: Specifies the default CA cert to use if TLS is used for
services in the internal network.
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
resources:
@ -163,10 +167,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 1}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags TAGS -v -e 'CONFIG'"
params:
TAGS: 'tripleo::firewall::rule'
CONFIG: *step_config
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}

View File

@ -48,7 +48,13 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -169,10 +175,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 5}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::cinder::backup_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerCinderBackupImage}
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -45,6 +45,13 @@ parameters:
default: 10280
description: The size of the loopback file used by the cinder LVM driver.
type: number
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -162,10 +169,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 5}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::cinder::volume_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerCinderVolumeImage}
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -51,6 +51,10 @@ parameters:
type: string
description: Specifies the default CA cert to use if TLS is used for
services in the internal network.
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
resources:
@ -68,7 +72,7 @@ resources:
RoleParameters: {get_param: RoleParameters}
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
outputs:
@ -248,10 +252,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,galera_ready,mysql_database,mysql_grant,mysql_user'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::mysql_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerMysqlImage}
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -36,6 +36,13 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -150,10 +157,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::database::redis_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: *redis_config_image
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -57,6 +57,13 @@ parameters:
HAProxyInternalTLSKeysDirectory:
default: '/etc/pki/tls/private/haproxy'
type: string
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -190,7 +197,7 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath=/etc/puppet/modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
params:
TAGS: 'tripleo::firewall::rule,pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
CONFIG:
@ -198,6 +205,11 @@ outputs:
- ';'
- - 'include ::tripleo::profile::base::pacemaker'
- 'include ::tripleo::profile::pacemaker::haproxy_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerHAProxyImage}
volumes:
list_concat:

View File

@ -36,6 +36,13 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -142,10 +149,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 5}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file_line,concat,augeas,TAGS --debug -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::constraint::location'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::manila::share_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerManilaShareImage}
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -44,6 +44,13 @@ parameters:
description: Port of the OVN Southbound DB server
type: number
default: 6642
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -112,7 +119,7 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 3}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ip,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation'
CONFIG:
@ -120,6 +127,11 @@ outputs:
- ';'
- - 'include ::tripleo::profile::base::pacemaker'
- 'include ::tripleo::profile::pacemaker::ovn_dbs_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: *ovn_dbs_config_image
volumes:
- /etc/hosts:/etc/hosts:ro

View File

@ -40,6 +40,13 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
ConfigDebug:
default: false
description: Whether to run config management (e.g. Puppet) in debug mode.
type: boolean
conditions:
puppet_debug_enabled: {get_param: ConfigDebug}
resources:
@ -185,10 +192,15 @@ outputs:
list_join:
- '; '
- - "cp -a /tmp/puppet-etc/* /etc/puppet; echo '{\"step\": 2}' > /etc/puppet/hieradata/docker.json"
- "FACTER_uuid=docker puppet apply --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
- "FACTER_uuid=docker puppet apply DEBUG --color=false --modulepath /etc/puppet/modules:/opt/stack/puppet-modules:/usr/share/openstack-puppet/modules --tags file,file_line,concat,augeas,TAGS -v -e 'CONFIG'"
params:
TAGS: 'pacemaker::resource::bundle,pacemaker::property,pacemaker::resource::ocf,pacemaker::constraint::order,pacemaker::constraint::colocation,rabbitmq_policy,rabbitmq_user,rabbitmq_ready'
CONFIG: 'include ::tripleo::profile::base::pacemaker;include ::tripleo::profile::pacemaker::rabbitmq_bundle'
DEBUG:
if:
- puppet_debug_enabled
- '--debug --verbose'
- ''
image: {get_param: DockerRabbitmqImage}
volumes:
- /etc/hosts:/etc/hosts:ro