Include the DB password in a Mistral environment for creating backups and restores

We need to include also the Undercloud DB in a Mistral
environment to be able to create the DB backup from the CLI.

Now, we do this using python and THT but we didn't include it.

Change-Id: If503e733b103a34ae5639eb56dfae05f9783d59a
Closes-Bug: 1812839
This commit is contained in:
Carlos Camacho 2019-01-22 12:50:01 +01:00
parent a79b7cb921
commit 166803d05f
2 changed files with 11 additions and 4 deletions

View File

@ -112,12 +112,14 @@ def _create_logging_cron(mistral):
print('INFO: Undercloud post - Cron triggers configured successfully.')
def _store_snmp_password_in_mistral_env(mistral):
""" Store the SNMP password in a mistral environment """
def _store_passwords_in_mistral_env(mistral):
""" Store required passwords in a mistral environment """
env_name = 'tripleo.undercloud-config'
config_data = {
'undercloud_ceilometer_snmpd_password':
CONF['snmp_readonly_user_password']
CONF['snmp_readonly_user_password'],
'undercloud_db_password':
CONF['undercloud_db_password']
}
try:
mistral.environments.get(env_name).variables
@ -179,7 +181,7 @@ try:
session=sdk.session)
_configure_wrokbooks_and_workflows(mistral)
_create_logging_cron(mistral)
_store_snmp_password_in_mistral_env(mistral)
_store_passwords_in_mistral_env(mistral)
_create_default_plan(mistral)
if tripleo_validations_enabled:
_prepare_ssh_environment(mistral)

View File

@ -37,6 +37,10 @@ parameters:
description: The user password for SNMPd with readonly rights running on all Overcloud nodes
type: string
hidden: true
MysqlRootPassword:
type: string
hidden: true
default: ''
DnsServers:
default: []
description: >
@ -212,6 +216,7 @@ resources:
cloud_name: {get_param: UndercloudCloudName}
home_dir: {get_param: UndercloudHomeDir}
snmp_readonly_user_password: {get_param: SnmpdReadonlyUserPassword}
undercloud_db_password: {get_param: MysqlRootPassword}
UndercloudCtlplaneNetworkConfig: