mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 17:22:49 +01:00
Add OLD_ db init files for soup compatibility
This commit is contained in:
@@ -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
|
||||||
|
|||||||
14
salt/playbook/OLD_db_init.sls
Normal file
14
salt/playbook/OLD_db_init.sls
Normal 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
|
||||||
8
salt/playbook/files/OLD_playbook_db_init.sh
Normal file
8
salt/playbook/files/OLD_playbook_db_init.sh
Normal 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"
|
||||||
1767
salt/playbook/files/OLD_playbook_db_init.sql
Normal file
1767
salt/playbook/files/OLD_playbook_db_init.sql
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user