From 4d7e03be85ce8a005aceca9cd1784b7cc5ad99eb Mon Sep 17 00:00:00 2001 From: Michele Baldessari Date: Sun, 17 Dec 2017 20:03:02 +0100 Subject: [PATCH] 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. Closes-Bug: #1738764 Change-Id: If529b83a7342b3ad17d705517978539d1c6b949e --- docker/services/haproxy.yaml | 13 +++++++++++-- docker/services/pacemaker/cinder-backup.yaml | 13 ++++++++++++- docker/services/pacemaker/cinder-volume.yaml | 14 +++++++++++++- docker/services/pacemaker/database/mysql.yaml | 13 +++++++++++-- docker/services/pacemaker/database/redis.yaml | 14 +++++++++++++- docker/services/pacemaker/haproxy.yaml | 14 +++++++++++++- docker/services/pacemaker/manila-share.yaml | 14 +++++++++++++- docker/services/pacemaker/ovn-dbs.yaml | 14 +++++++++++++- docker/services/pacemaker/rabbitmq.yaml | 14 +++++++++++++- 9 files changed, 112 insertions(+), 11 deletions(-) diff --git a/docker/services/haproxy.yaml b/docker/services/haproxy.yaml index e2b1ade0f4..ecccb45118 100644 --- a/docker/services/haproxy.yaml +++ b/docker/services/haproxy.yaml @@ -78,9 +78,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]} public_tls_enabled: or: @@ -190,11 +194,16 @@ 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: get_attr: [HAProxyBase, role_data, step_config] + DEBUG: + if: + - puppet_debug_enabled + - '--debug --verbose' + - '' volumes: list_concat: - {get_attr: [ContainersCommon, volumes]} diff --git a/docker/services/pacemaker/cinder-backup.yaml b/docker/services/pacemaker/cinder-backup.yaml index 40df9c5a4a..c0ece3d577 100644 --- a/docker/services/pacemaker/cinder-backup.yaml +++ b/docker/services/pacemaker/cinder-backup.yaml @@ -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: @@ -168,10 +174,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 diff --git a/docker/services/pacemaker/cinder-volume.yaml b/docker/services/pacemaker/cinder-volume.yaml index 0f2c5e0133..6aab896adc 100644 --- a/docker/services/pacemaker/cinder-volume.yaml +++ b/docker/services/pacemaker/cinder-volume.yaml @@ -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: @@ -161,10 +168,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 diff --git a/docker/services/pacemaker/database/mysql.yaml b/docker/services/pacemaker/database/mysql.yaml index a43c8a0deb..5ead7d04c0 100644 --- a/docker/services/pacemaker/database/mysql.yaml +++ b/docker/services/pacemaker/database/mysql.yaml @@ -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: @@ -247,10 +251,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 diff --git a/docker/services/pacemaker/database/redis.yaml b/docker/services/pacemaker/database/redis.yaml index 8ce4013f6e..6407166181 100644 --- a/docker/services/pacemaker/database/redis.yaml +++ b/docker/services/pacemaker/database/redis.yaml @@ -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: @@ -149,10 +156,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 diff --git a/docker/services/pacemaker/haproxy.yaml b/docker/services/pacemaker/haproxy.yaml index 12862565ab..42a937d446 100644 --- a/docker/services/pacemaker/haproxy.yaml +++ b/docker/services/pacemaker/haproxy.yaml @@ -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: @@ -189,7 +196,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: @@ -197,6 +204,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: diff --git a/docker/services/pacemaker/manila-share.yaml b/docker/services/pacemaker/manila-share.yaml index ed14ac027f..1d9dfec1fa 100644 --- a/docker/services/pacemaker/manila-share.yaml +++ b/docker/services/pacemaker/manila-share.yaml @@ -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: @@ -141,10 +148,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 diff --git a/docker/services/pacemaker/ovn-dbs.yaml b/docker/services/pacemaker/ovn-dbs.yaml index 4a04789d15..d7228bd691 100644 --- a/docker/services/pacemaker/ovn-dbs.yaml +++ b/docker/services/pacemaker/ovn-dbs.yaml @@ -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: @@ -111,7 +118,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: @@ -119,6 +126,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 diff --git a/docker/services/pacemaker/rabbitmq.yaml b/docker/services/pacemaker/rabbitmq.yaml index 81ec99f4b1..e48a1380d1 100644 --- a/docker/services/pacemaker/rabbitmq.yaml +++ b/docker/services/pacemaker/rabbitmq.yaml @@ -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: @@ -187,10 +194,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' 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