From 2d5b6760b72dc9abc8717f30471245dc15af64fa Mon Sep 17 00:00:00 2001 From: Zachary Puls Date: Wed, 20 Jun 2018 11:18:00 -0500 Subject: [PATCH 1/4] Update st2bootstrap-deb.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow for different usernames and group names, allow for spaces in both username and group name. E.g. 20180620T110239-0500 chown: invalid group: ‘zpuls@kfn.local:zpuls@kfn.local’ 20180620T110239-0500 ############### ERROR ############### 20180620T110239-0500 # Failed on Configure st2 CLI config # 20180620T110239-0500 ##################################### When the user is "zpuls@kfn.local" and group is "domain users@kfn.local". --- scripts/st2bootstrap-deb.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/st2bootstrap-deb.sh b/scripts/st2bootstrap-deb.sh index ebdd561e..3df9904b 100644 --- a/scripts/st2bootstrap-deb.sh +++ b/scripts/st2bootstrap-deb.sh @@ -288,6 +288,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -325,7 +326,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R "${CURRENT_USER}":"${CURRENT_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } From 0fafdf56389a0591ea49b47af95d8ea90b51ef27 Mon Sep 17 00:00:00 2001 From: Zachary Puls Date: Wed, 20 Jun 2018 11:24:30 -0500 Subject: [PATCH 2/4] Update common.sh Actually edit the template this time. --- scripts/includes/common.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/includes/common.sh b/scripts/includes/common.sh index 2279e54e..d98271a9 100644 --- a/scripts/includes/common.sh +++ b/scripts/includes/common.sh @@ -171,6 +171,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -208,7 +209,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R "${CURRENT_USER}":"${CURRENT_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } From 7293f32a85392a98a46118c00559a8b7efa6ada5 Mon Sep 17 00:00:00 2001 From: Zachary Puls Date: Wed, 20 Jun 2018 11:25:39 -0500 Subject: [PATCH 3/4] Update st2bootstrap-el6.sh Actually edit the template this time. --- scripts/st2bootstrap-el6.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/st2bootstrap-el6.sh b/scripts/st2bootstrap-el6.sh index dcde3d49..d2aa5210 100644 --- a/scripts/st2bootstrap-el6.sh +++ b/scripts/st2bootstrap-el6.sh @@ -283,6 +283,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -320,7 +321,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R "${CURRENT_USER}":"${CURRENT_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} } From fea8de86f56051dcb694dca5727bf91a761a5e39 Mon Sep 17 00:00:00 2001 From: Zachary Puls Date: Wed, 20 Jun 2018 11:26:59 -0500 Subject: [PATCH 4/4] Update st2bootstrap-el7.sh Actually edit the template this time. --- scripts/st2bootstrap-el7.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/st2bootstrap-el7.sh b/scripts/st2bootstrap-el7.sh index 07eb2715..133e715f 100644 --- a/scripts/st2bootstrap-el7.sh +++ b/scripts/st2bootstrap-el7.sh @@ -283,6 +283,7 @@ configure_st2_cli_config() { # Configure CLI config (write credentials for the root user and user which ran the script) ROOT_USER="root" CURRENT_USER=$(whoami) + CURRENT_USER_GROUP=$(id -gn) ROOT_HOME=$(eval echo ~${ROOT_USER}) : "${HOME:=$(eval echo ~${CURRENT_USER})}" @@ -320,7 +321,7 @@ password = ${PASSWORD} EOT" # Fix the permissions - sudo chown -R ${CURRENT_USER}:${CURRENT_USER} ${CURRENT_USER_CLI_CONFIG_DIRECTORY} + sudo chown -R "${CURRENT_USER}":"${CURRENT_USER_GROUP}" ${CURRENT_USER_CLI_CONFIG_DIRECTORY} }