]> granicus.if.org Git - icinga2/commitdiff
Vagrant: Install icinga-web.
authorGunnar Beutner <gunnar.beutner@netways.de>
Mon, 14 Oct 2013 12:12:32 +0000 (14:12 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 14 Oct 2013 12:30:23 +0000 (14:30 +0200)
.vagrant-puppet/manifests/default.pp

index 586e183c46cd6d3207ec3bf374ffcb5a5b361644..8391be71cdf9fb23c9b2d32320e43d5d1eaebde7 100644 (file)
@@ -15,6 +15,14 @@ exec { 'create-mysql-icinga2-ido-db':
   require => Service['mysqld']
 }
 
+exec { 'create-mysql-icinga-web-db':
+  unless => 'mysql -uicinga_web -picinga_web icinga_web',
+  command => 'mysql -uroot -e "CREATE DATABASE icinga_web; \
+             GRANT ALL ON icinga_web.* TO icinga_web@localhost \
+             IDENTIFIED BY \'icinga_web\';"',
+  require => Service['mysqld']
+}
+
 # enable when icinga2-ido-pgsql is ready
 #exec { 'create-pgsql-icinga2-ido-db':
 #  unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga\'" | grep -q 1',
@@ -76,6 +84,11 @@ package { $icinga2_main_packages:
 }
 
 
+package { 'icinga-web':
+  ensure => installed,
+  require => Class['icinga-rpm-snapshot']
+}
+
 # enable http 80
 exec { 'iptables-allow-http':
   unless  => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables',
@@ -141,4 +154,9 @@ exec { 'populate-icinga2-ido-mysql-db':
 #  require => [ Package['icinga2-ido-pgsql'], Exec['create-pgsql-icinga2-ido-db'] ]
 #}
 
+exec { 'populate-icinga-web-mysql-db':
+  unless  => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null',
+  command => 'mysql -uicinga_web -picinga_web icinga_web < /usr/share/icinga-web/etc/schema/mysql.sql',
+  require => [ Package['icinga-web'], Exec['create-mysql-icinga-web-db'] ]
+}