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 <wallysson.silva@windriver.com>
This commit is contained in:
Wallysson Silva 2024-11-27 14:40:49 -03:00
parent cf6171a7dd
commit 74f90fc674
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;