Playbook db init fix

This commit is contained in:
Josh Brower
2020-07-14 09:09:47 -04:00
parent 09c460dbe9
commit b884e09e7a
2 changed files with 6 additions and 15 deletions

View File

@@ -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:

View File

@@ -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