Skip to content

Commit

Permalink
Switch initialize to true in icingaweb2 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoduykhanh authored and arioch committed Apr 18, 2016
1 parent 3f25a73 commit 41c46bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions manifests/initialize.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class icingaweb2::initialize {
if $::icingaweb2::initialize {
case $::operatingsystem {
'RedHat', 'CentOS': {
'RedHat', 'CentOS', 'Debian', 'Ubuntu': {
case $::icingaweb2::web_db {
'mysql': {

Expand All @@ -16,13 +16,13 @@
}

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,
}
}
Expand Down

0 comments on commit 41c46bd

Please sign in to comment.