From 74f90fc674c5f50f75c6f3e7370cbda636cd450c Mon Sep 17 00:00:00 2001 From: Wallysson Silva Date: Wed, 27 Nov 2024 14:40:49 -0300 Subject: [PATCH] Escape $ character in dc configuration files This ensures password containing a $ symbol can be read by oslo_config. oslo_config supports variable substitution [1] and to avoid substitution is need to escape $ with $$. [1]: https://docs.openstack.org/oslo.config/latest/configuration/format.html#substitution Test Plan: - PASS: bootstrap a system controller with keystone admin password containing $, dc services should start Closes-Bug: 2089783 Change-Id: Icdbfae04b663bb9373116ff4967d4d78f57625c6 Signed-off-by: Wallysson Silva --- modules/puppet-dcmanager/src/dcmanager/manifests/api.pp | 2 +- modules/puppet-dcorch/src/dcorch/manifests/api_proxy.pp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/puppet-dcmanager/src/dcmanager/manifests/api.pp b/modules/puppet-dcmanager/src/dcmanager/manifests/api.pp index 46ef4aa39..cc63eb5e4 100644 --- a/modules/puppet-dcmanager/src/dcmanager/manifests/api.pp +++ b/modules/puppet-dcmanager/src/dcmanager/manifests/api.pp @@ -160,7 +160,7 @@ class dcmanager::api ( dcmanager_config { 'cache/admin_tenant': value => $keystone_admin_tenant; 'cache/admin_username': value => $keystone_admin_user; - 'cache/admin_password': value => $keystone_admin_password, secret=> true; + 'cache/admin_password': value => regsubst($keystone_admin_password, '\\$', '$$'), secret=> true; } dcmanager_config { 'endpoint_cache/auth_plugin': value => $auth_type; diff --git a/modules/puppet-dcorch/src/dcorch/manifests/api_proxy.pp b/modules/puppet-dcorch/src/dcorch/manifests/api_proxy.pp index 536340264..13d5427cb 100644 --- a/modules/puppet-dcorch/src/dcorch/manifests/api_proxy.pp +++ b/modules/puppet-dcorch/src/dcorch/manifests/api_proxy.pp @@ -159,7 +159,7 @@ class dcorch::api_proxy ( dcorch_config { 'cache/admin_tenant': value => $keystone_admin_tenant; 'cache/admin_username': value => $keystone_admin_user; - 'cache/admin_password': value => $keystone_admin_password, secret=> true; + 'cache/admin_password': value => regsubst($keystone_admin_password, '\\$', '$$') , secret=> true; } dcorch_config { 'endpoint_cache/auth_plugin': value => $auth_type;