Add initial meta-stx to support StarlingX build
[pti/rtp.git] / meta-stx / recipes-support / puppet / files / puppet-keystone / 0004-escape-special-characters-in-bootstrap.patch
1 From 70d22113cc8d58b6546cb4917c27f9aae51787c5 Mon Sep 17 00:00:00 2001
2 From: Kam Nasim <kam.nasim@windriver.com>
3 Date: Mon, 2 Apr 2018 16:13:31 -0400
4 Subject: [PATCH] CGTS-9320: config_controller fails when admin pw containing $
5
6 Escape special characters when executing the keystone-manage bootstrap
7 command since the keystone CLI argparse will parse "Madawa$ka1" as
8 "Madawa" which will cause the Keystone ADMIN acct to be created with an
9 incorrect password. Puppet will detect this and attempt to course
10 correct by sending an UPDATE User request to Keystone, which does set
11 the right password but causes other failures in config_controller
12 ---
13  manifests/init.pp | 7 ++++++-
14  1 file changed, 6 insertions(+), 1 deletion(-)
15
16 diff --git a/manifests/init.pp b/manifests/init.pp
17 index d64638c..89af303 100644
18 --- a/manifests/init.pp
19 +++ b/manifests/init.pp
20 @@ -1292,10 +1292,15 @@ running as a standalone service, or httpd for being run by a httpd server")
21    }
22  
23    if $enable_bootstrap {
24 +    #(NOTE: knasim-wrs): escape special characters in the password otherwise the
25 +    # keyword-manage bootstrap CLI may parse the password incorrectly, causing
26 +    # the admin account to be created with an incorrect password
27 +    $admin_password_escaped = shell_escape($admin_password_real)
28 +
29      # this requires the database to be up and running and configured
30      # and is only run once, so we don't need to notify the service
31      exec { 'keystone-manage bootstrap':
32 -      command     => "keystone-manage bootstrap --bootstrap-password ${admin_password_real}",
33 +      command     => "keystone-manage bootstrap --bootstrap-password ${admin_password_escaped}",
34        user        => $keystone_user,
35        path        => '/usr/bin',
36        refreshonly => true,
37 -- 
38 1.8.3.1
39