Bugfix: only create db scheme once when tables are not yet deployed
This commit is contained in:
parent
df99507221
commit
0cc89ec9fd
1 changed files with 2 additions and 2 deletions
|
@ -9,8 +9,8 @@ class icingaweb2::initialize {
|
||||||
case $::icingaweb2::web_db {
|
case $::icingaweb2::web_db {
|
||||||
'mysql': {
|
'mysql': {
|
||||||
exec { 'create db scheme':
|
exec { 'create db scheme':
|
||||||
command => "mysql -u ${::icingaweb2::web_db_user} -p${::icingaweb2::web_db_pass} ${::icingaweb2::web_db_name} < /usr/share/doc/icingaweb2/schema/mysql.schema.sql",
|
command => "mysql --defaults-file='/root/.my.cnf' ${::icingaweb2::web_db_name} < /usr/share/doc/icingaweb2/schema/mysql.schema.sql",
|
||||||
onlyif => 'test -f /root/.my.cnf',
|
unless => "mysql --defaults-file='/root/.my.cnf' ${::icingaweb2::web_db_name} -e \"SELECT 1 FROM icingaweb_user LIMIT 1;\"",
|
||||||
notify => Exec['create web user']
|
notify => Exec['create web user']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue