Add OLD_ db init files for soup compatibility

This commit is contained in:
William Wernert
2020-10-02 14:12:23 -04:00
parent ab662e9b81
commit 54da2b869c
4 changed files with 1790 additions and 1 deletions

View File

@@ -169,7 +169,7 @@ masterunlock() {
playbook() { playbook() {
echo "Applying playbook settings" echo "Applying playbook settings"
if [[ "$INSTALLEDVERSION" =~ rc.1 ]]; then if [[ "$INSTALLEDVERSION" =~ rc.1 ]]; then
salt-call state.apply playbook.db_init salt-call state.apply playbook.OLD_db_init
rm -f /opt/so/rules/elastalert/playbook/*.yaml rm -f /opt/so/rules/elastalert/playbook/*.yaml
so-playbook-ruleupdate >> /root/soup_playbook_rule_update.log 2>&1 & so-playbook-ruleupdate >> /root/soup_playbook_rule_update.log 2>&1 &
fi fi

View File

@@ -0,0 +1,14 @@
# This state will import the initial default playbook database.
# If there is an existing playbook database, it will be overwritten - no backups are made.
include:
- mysql
salt://playbook/files/OLD_playbook_db_init.sh:
cmd.script:
- cwd: /root
- template: jinja
'sleep 5':
cmd.run

View File

@@ -0,0 +1,8 @@
#!/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/playbook_db_init-old.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