[icinga-checkins] icinga.org: icinga-vagrant/master: icingaweb2: Fix provisioning a default user w/o setup wizard

git at icinga.org git at icinga.org
Fri Nov 14 00:34:02 CET 2014


Module: icinga-vagrant
Branch: master
Commit: 9b4cc43554b83ac661c87bc1041994189c4b18b4
URL:    https://git.icinga.org/?p=icinga-vagrant.git;a=commit;h=9b4cc43554b83ac661c87bc1041994189c4b18b4

Author: Michael Friedrich <michael.friedrich at gmail.com>
Date:   Fri Nov 14 00:33:25 2014 +0100

icingaweb2: Fix provisioning a default user w/o setup wizard

---

 .../.vagrant-puppet/modules/icingaweb2/manifests/init.pp       |    8 +++++++-
 .../.vagrant-puppet/modules/icingaweb2/manifests/init.pp       |    8 +++++++-
 icinga2x/.vagrant-puppet/modules/icingaweb2/manifests/init.pp  |    8 +++++++-
 3 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/icinga2x-agent/.vagrant-puppet/modules/icingaweb2/manifests/init.pp b/icinga2x-agent/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
index 8962860..1bd8d46 100644
--- a/icinga2x-agent/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
+++ b/icinga2x-agent/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
@@ -33,8 +33,14 @@ class icingaweb2-internal-db-mysql {
 
   exec { 'populate-icingaweb-mysql-db':
     path => '/bin:/usr/bin:/sbin:/usr/sbin',
-    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
     command => 'mysql -uicingaweb -picingaweb icingaweb < /usr/share/doc/icingaweb2-$(rpm -q icingaweb2 | cut -d\'-\' -f2)/schema/mysql.schema.sql',
     require => [ Exec['create-mysql-icingaweb-db'], Package['icingaweb2'] ]
+  } ->
+  exec { 'populate-icingaweb-mysql-db-create-default-account':
+    path => '/bin:/usr/bin:/sbin:/usr/sbin',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
+    command => 'mysql -uicingaweb -picingaweb icingaweb -e "INSERT INTO icingaweb_user (name, active, password_hash) VALUES (\'icingaadmin\', 1, \'$1$iQSrnmO9$T3NVTu0zBkfuim4lWNRmH.\');"',
+    require => [ Exec['populate-icingaweb-mysql-db'], Package['icingaweb2'] ]
   }
 }
diff --git a/icinga2x-cluster/.vagrant-puppet/modules/icingaweb2/manifests/init.pp b/icinga2x-cluster/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
index 8962860..1bd8d46 100644
--- a/icinga2x-cluster/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
+++ b/icinga2x-cluster/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
@@ -33,8 +33,14 @@ class icingaweb2-internal-db-mysql {
 
   exec { 'populate-icingaweb-mysql-db':
     path => '/bin:/usr/bin:/sbin:/usr/sbin',
-    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
     command => 'mysql -uicingaweb -picingaweb icingaweb < /usr/share/doc/icingaweb2-$(rpm -q icingaweb2 | cut -d\'-\' -f2)/schema/mysql.schema.sql',
     require => [ Exec['create-mysql-icingaweb-db'], Package['icingaweb2'] ]
+  } ->
+  exec { 'populate-icingaweb-mysql-db-create-default-account':
+    path => '/bin:/usr/bin:/sbin:/usr/sbin',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
+    command => 'mysql -uicingaweb -picingaweb icingaweb -e "INSERT INTO icingaweb_user (name, active, password_hash) VALUES (\'icingaadmin\', 1, \'$1$iQSrnmO9$T3NVTu0zBkfuim4lWNRmH.\');"',
+    require => [ Exec['populate-icingaweb-mysql-db'], Package['icingaweb2'] ]
   }
 }
diff --git a/icinga2x/.vagrant-puppet/modules/icingaweb2/manifests/init.pp b/icinga2x/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
index 8962860..1bd8d46 100644
--- a/icinga2x/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
+++ b/icinga2x/.vagrant-puppet/modules/icingaweb2/manifests/init.pp
@@ -33,8 +33,14 @@ class icingaweb2-internal-db-mysql {
 
   exec { 'populate-icingaweb-mysql-db':
     path => '/bin:/usr/bin:/sbin:/usr/sbin',
-    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
     command => 'mysql -uicingaweb -picingaweb icingaweb < /usr/share/doc/icingaweb2-$(rpm -q icingaweb2 | cut -d\'-\' -f2)/schema/mysql.schema.sql',
     require => [ Exec['create-mysql-icingaweb-db'], Package['icingaweb2'] ]
+  } ->
+  exec { 'populate-icingaweb-mysql-db-create-default-account':
+    path => '/bin:/usr/bin:/sbin:/usr/sbin',
+    unless  => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_user;" &> /dev/null',
+    command => 'mysql -uicingaweb -picingaweb icingaweb -e "INSERT INTO icingaweb_user (name, active, password_hash) VALUES (\'icingaadmin\', 1, \'$1$iQSrnmO9$T3NVTu0zBkfuim4lWNRmH.\');"',
+    require => [ Exec['populate-icingaweb-mysql-db'], Package['icingaweb2'] ]
   }
 }



More information about the icinga-checkins mailing list