From f5c903c89636512a9bd14cf62b00850cab760104 Mon Sep 17 00:00:00 2001
From: Derek Higgins <derekh@redhat.com>
Date: Tue, 5 May 2015 13:59:14 +0100
Subject: [PATCH] Reuse the undercloud service passwords as db passwords.

We need to stop using "unset" as the password for all databases. Ideally we
would add a "XxxxDSN" parameter (e.g. KeystoneDSN) but to remain consistent
with the overcloud for now we reuse the service passwords

Change-Id: I35c4fa3478eea92f81aa381fd2ab5fac5aae849f
---
 undercloud-bm-nova-config.yaml   |  4 ++--
 undercloud-source.yaml           | 10 +++++-----
 undercloud-vm-ironic-config.yaml |  4 ++--
 undercloud-vm-nova-config.yaml   |  4 ++--
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/undercloud-bm-nova-config.yaml b/undercloud-bm-nova-config.yaml
index e70c909902..306dc0a1c1 100644
--- a/undercloud-bm-nova-config.yaml
+++ b/undercloud-bm-nova-config.yaml
@@ -8,7 +8,7 @@ resources:
           compute_driver: {get_param: NovaComputeDriver}
           compute_manager: {get_param: NovaComputeManager}
           scheduler_host_manager: {get_param: NovaSchedulerHostManager}
-          db: mysql://nova:unset@localhost/nova
+          db: {list_join: ['', ['mysql://nova:', {get_param: NovaPassword}, '@localhost/nova']]}
           default_ephemeral_format: ext4
           host: 127.0.0.1
           metadata-proxy: false
@@ -17,7 +17,7 @@ resources:
             reserved_host_memory_mb: 0
           baremetal:
             arch: {get_input: nova_arch}
-            db: mysql://nova:unset@localhost/nova_bm
+            db: {list_join: ['', ['mysql://nova:', {get_param: NovaPassword}, '@localhost/nova_bm']]}
             power_manager: {get_input: power_manager}
             pxe_deploy_timeout: {get_input: pxe_deploy_timeout}
           service-password: {get_input: nova_service_password}
diff --git a/undercloud-source.yaml b/undercloud-source.yaml
index ce5b7e8de0..6fe2066d24 100644
--- a/undercloud-source.yaml
+++ b/undercloud-source.yaml
@@ -260,7 +260,7 @@ resources:
           recheck_interval : 5
           quorum_policy : ignore
         ceilometer:
-          db: mysql://ceilometer:unset@localhost/ceilometer
+          db: {list_join: ['', ['mysql://ceilometer:', {get_param: CeilometerPassword}, '@localhost/ceilometer']]}
           debug: {get_param: Debug}
           metering_secret: {get_param: CeilometerMeteringSecret}
           snmpd_readonly_user_name:
@@ -272,7 +272,7 @@ resources:
         db-password: unset
         glance:
           backend: file
-          db: mysql://glance:unset@localhost/glance
+          db: {list_join: ['', ['mysql://glance:', {get_param: GlancePassword}, '@localhost/glance']]}
           debug: {get_param: Debug}
           host: 127.0.0.1
           port:
@@ -291,14 +291,14 @@ resources:
           admin_tenant_name: service
           admin_user: heat
           auth_encryption_key: unset___________
-          db: mysql://heat:unset@localhost/heat
+          db: {list_join: ['', ['mysql://heat:', {get_param: HeatPassword}, '@localhost/heat']]}
           debug: {get_param: Debug}
           stack_domain_admin_password: {get_param: HeatStackDomainAdminPassword}
           watch_server_url: {get_input: heat.watch_server_url}
           metadata_server_url: {get_input: heat.metadata_server_url}
           waitcondition_server_url: {get_input: heat.waitcondition_server_url}
         keystone:
-          db: mysql://keystone:unset@localhost/keystone
+          db: {list_join: ['', ['mysql://keystone:', {get_param: AdminToken}, '@localhost/keystone']]}
           debug: {get_param: Debug}
           host: 127.0.0.1
           ca_certificate: {get_param: KeystoneCACertificate}
@@ -314,7 +314,7 @@ resources:
         neutron:
           debug: {get_param: Debug}
           host: 127.0.0.1
-          ovs_db: mysql://neutron:unset@localhost/ovs_neutron?charset=utf8
+          ovs_db: {list_join: ['', ['mysql://neutron:', {get_param: NeutronPassword}, '@localhost/ovs_neutron?charset=utf8']]}
           ovs:
             local_ip:
               get_input: controller_host
diff --git a/undercloud-vm-ironic-config.yaml b/undercloud-vm-ironic-config.yaml
index f5aa4981a1..cc0dafb624 100644
--- a/undercloud-vm-ironic-config.yaml
+++ b/undercloud-vm-ironic-config.yaml
@@ -8,7 +8,7 @@ resources:
           compute_driver: {get_param: NovaComputeDriver}
           compute_manager: {get_param: NovaComputeManager}
           scheduler_host_manager: {get_param: NovaSchedulerHostManager}
-          db: mysql://nova:unset@localhost/nova
+          db: {list_join: ['', ['mysql://nova:', {get_param: NovaPassword}, '@localhost/nova']]}
           debug: {get_param: Debug}
           default_ephemeral_format: ext4
           host: 127.0.0.1
@@ -22,6 +22,6 @@ resources:
     properties:
       config:
         ironic:
-          db: mysql://ironic:unset@localhost/ironic
+          db: {list_join: ['', ['mysql://ironic:', {get_param: IronicPassword}, '@localhost/ironic']]}
           service-password: {get_input: ironic_service_password}
           virtual_power_ssh_key: {get_input: virtual_power_ssh_key}
diff --git a/undercloud-vm-nova-config.yaml b/undercloud-vm-nova-config.yaml
index 9dbb8c22e4..1fb8abb327 100644
--- a/undercloud-vm-nova-config.yaml
+++ b/undercloud-vm-nova-config.yaml
@@ -8,7 +8,7 @@ resources:
           compute_driver: {get_param: NovaComputeDriver}
           compute_manager: {get_param: NovaComputeManager}
           scheduler_host_manager: {get_param: NovaSchedulerHostManager}
-          db: mysql://nova:unset@localhost/nova
+          db: {list_join: ['', ['mysql://nova:', {get_param: NovaPassword}, '@localhost/nova']]}
           default_ephemeral_format: ext4
           host: 127.0.0.1
           metadata-proxy: false
@@ -17,7 +17,7 @@ resources:
             reserved_host_memory_mb: 0
           baremetal:
             arch: {get_input: nova_arch}
-            db: mysql://nova:unset@localhost/nova_bm
+            db: {list_join: ['', ['mysql://nova:', {get_param: NovaPassword}, '@localhost/nova_bm']]}
             power_manager: {get_input: power_manager}
             pxe_deploy_timeout: {get_input: pxe_deploy_timeout}
             virtual_power: