From a5bf4bbb35577bcce1ebe5fed0cf426015bb93b8 Mon Sep 17 00:00:00 2001 From: William Wernert Date: Thu, 1 Oct 2020 14:47:18 -0400 Subject: [PATCH] Fix test for key in global.sls --- salt/playbook/files/automation_user_create.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/playbook/files/automation_user_create.sh b/salt/playbook/files/automation_user_create.sh index b895ae820..632a73c41 100644 --- a/salt/playbook/files/automation_user_create.sh +++ b/salt/playbook/files/automation_user_create.sh @@ -36,7 +36,7 @@ while [[ $try_count -le 6 ]]; do }" # Search for the needed keys in the global pillar file, if missing then add them - if (sed -z '/playbook:\n api_key:.*/Q' $local_salt_dir/pillar/global.sls); then + if (grep -Pzq 'playbook:\n api_key:.*' $local_salt_dir/pillar/global.sls); then sed -iz "s/playbook:\n api_key:.*/playbook:\n api_key: ${automation_api_key}/" $local_salt_dir/pillar/global.sls else {