mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Merge pull request #993 from Security-Onion-Solutions/bugfix/playbook-init
Bugfix/playbook init
This commit is contained in:
14
salt/playbook/db_init.sls
Normal file
14
salt/playbook/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/playbook_db_init.sh:
|
||||
cmd.script:
|
||||
- cwd: /root
|
||||
- template: jinja
|
||||
|
||||
'sleep 5':
|
||||
cmd.run
|
||||
@@ -6,17 +6,8 @@
|
||||
{%- set MYSQLPASS = salt['pillar.get']('secrets:mysql', None) -%}
|
||||
{%- set PLAYBOOKPASS = salt['pillar.get']('secrets:playbook', None) -%}
|
||||
|
||||
{% if salt['mysql.db_exists']('playbook') %}
|
||||
#Playbook database exists - Do nothing
|
||||
{% else %}
|
||||
salt://playbook/files/playbook_db_init.sh:
|
||||
cmd.script:
|
||||
- cwd: /root
|
||||
- template: jinja
|
||||
|
||||
'sleep 5':
|
||||
cmd.run
|
||||
{% endif %}
|
||||
include:
|
||||
- mysql
|
||||
|
||||
create_playbookdbuser:
|
||||
module.run:
|
||||
|
||||
@@ -539,8 +539,8 @@ fi
|
||||
fi
|
||||
|
||||
if [[ "$PLAYBOOK" = 1 ]]; then
|
||||
set_progress_str 73 "$(print_salt_state_apply 'mysql')"
|
||||
salt-call state.apply -l info mysql >> $setup_log 2>&1
|
||||
set_progress_str 73 "$(print_salt_state_apply 'playbook.db_init')"
|
||||
salt-call state.apply -l info playbook.db_init >> $setup_log 2>&1
|
||||
|
||||
set_progress_str 73 "$(print_salt_state_apply 'playbook')"
|
||||
salt-call state.apply -l info playbook >> $setup_log 2>&1
|
||||
|
||||
Reference in New Issue
Block a user