Switch initialize to true in icingaweb2 setup

This commit is contained in:
Khanh Ngo 2016-04-18 09:36:14 +07:00 committed by Tom De Vylder
parent 3f25a733a1
commit 41c46bdf02

View file

@ -5,7 +5,7 @@
class icingaweb2::initialize {
if $::icingaweb2::initialize {
case $::operatingsystem {
'RedHat', 'CentOS': {
'RedHat', 'CentOS', 'Debian', 'Ubuntu': {
case $::icingaweb2::web_db {
'mysql': {
@ -16,13 +16,13 @@ class icingaweb2::initialize {
}
exec { 'create db scheme':
command => "mysql --defaults-file='/root/.my.cnf' ${::icingaweb2::web_db_name} < ${sql_schema_location}",
unless => "mysql --defaults-file='/root/.my.cnf' ${::icingaweb2::web_db_name} -e \"SELECT 1 FROM icingaweb_user LIMIT 1;\"",
command => "mysql -h ${::icingaweb2::web_db_host} -u${::icingaweb2::web_db_user} -p${::icingaweb2::web_db_pass} ${::icingaweb2::web_db_name} < ${sql_schema_location}",
unless => "mysql -h ${::icingaweb2::web_db_host} -u${::icingaweb2::web_db_user} -p${::icingaweb2::web_db_pass} ${::icingaweb2::web_db_name} -e \"SELECT 1 FROM icingaweb_user LIMIT 1;\"",
notify => Exec['create web user']
}
exec { 'create web user':
command => "mysql --defaults-file='/root/.my.cnf' ${::icingaweb2::web_db_name} -e \" INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '\\\$1\\\$EzxLOFDr\\\$giVx3bGhVm4lDUAw6srGX1');\"",
command => "mysql -h ${::icingaweb2::web_db_host} -u${::icingaweb2::web_db_user} -p${::icingaweb2::web_db_pass} ${::icingaweb2::web_db_name} -e \" INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '\\\$1\\\$EzxLOFDr\\\$giVx3bGhVm4lDUAw6srGX1');\"",
refreshonly => true,
}
}