mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-20 16:03:06 +01:00
Move In Day
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# {%- set MYSQLPASS = salt['pillar.get']('secrets:mysql', None) %}
|
||||
|
||||
default_salt_dir=/opt/so/saltstack/default
|
||||
|
||||
docker cp $default_salt_dir/salt/playbook/files/OLD_playbook_db_init.sql so-mysql:/tmp/playbook_db_init.sql
|
||||
docker exec so-mysql /bin/bash -c "/usr/bin/mysql -b -uroot -p{{MYSQLPASS}} < /tmp/playbook_db_init.sql"
|
||||
File diff suppressed because one or more lines are too long
@@ -37,15 +37,8 @@ while [[ $try_count -le 6 ]]; do
|
||||
\"user_id\" : ${automation_user_id}
|
||||
}"
|
||||
|
||||
# Search for the needed keys in the global pillar file, if missing then add them
|
||||
if (grep -Pzq 'playbook:\n api_key:.*' $local_salt_dir/pillar/global.sls); then
|
||||
sed -e '1h;2,$H;$!d;g' -e "s/playbook:\n api_key:.*/playbook:\n api_key: ${automation_api_key}/m" -i $local_salt_dir/pillar/global.sls
|
||||
else
|
||||
{
|
||||
echo "playbook:"
|
||||
echo " api_key: ${automation_api_key}"
|
||||
} >> $local_salt_dir/pillar/global.sls
|
||||
fi
|
||||
# Update the Automation API key in the secrets pillar
|
||||
sed "s/playbook_automation_api_key:/playbook_automation_api_key: ${automation_api_key}/g" -i $local_salt_dir/pillar/secrets.sls
|
||||
exit 0
|
||||
fi
|
||||
((try_count++))
|
||||
|
||||
Reference in New Issue
Block a user