2014-09-08 12:24:28 +02:00
|
|
|
class icingaweb2_dev {
|
2014-09-10 11:45:57 +02:00
|
|
|
include apache
|
|
|
|
|
2014-09-10 11:27:28 +02:00
|
|
|
Exec { path => '/bin:/usr/bin' }
|
|
|
|
|
2014-09-09 13:19:12 +02:00
|
|
|
mysql::database::populate { 'icingaweb':
|
2014-09-02 12:21:28 +02:00
|
|
|
username => 'icingaweb',
|
|
|
|
password => 'icingaweb',
|
2014-08-06 13:27:16 +02:00
|
|
|
privileges => 'ALL',
|
2014-09-09 13:19:12 +02:00
|
|
|
schemafile => '/vagrant/etc/schema/accounts.mysql.sql',
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|
|
|
|
|
2014-09-09 13:19:12 +02:00
|
|
|
pgsql::database::populate { 'icingaweb':
|
2014-08-06 13:27:16 +02:00
|
|
|
username => 'icingaweb',
|
2014-09-09 15:15:53 +02:00
|
|
|
password => 'icingaweb',
|
2014-09-09 13:19:12 +02:00
|
|
|
schemafile => '/vagrant/etc/schema/accounts.pgsql.sql',
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'populate-icingaweb-mysql-db-preferences':
|
|
|
|
unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM preference;" &> /dev/null',
|
|
|
|
command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/preferences.mysql.sql',
|
2014-09-09 13:19:12 +02:00
|
|
|
require => Mysql::Database::Populate['icingaweb'],
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|
|
|
|
|
2014-09-09 13:19:12 +02:00
|
|
|
exec { 'populate-icingweb-pgsql-db-preferences':
|
2014-08-06 13:27:16 +02:00
|
|
|
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM preference;" &> /dev/null',
|
2014-09-10 17:49:17 +02:00
|
|
|
command => 'psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/preferences.pgsql.sql',
|
|
|
|
user => 'postgres',
|
2014-09-09 13:19:12 +02:00
|
|
|
require => Pgsql::Database::Populate['icingaweb'],
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/httpd/conf.d/icingaweb.conf':
|
|
|
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf',
|
|
|
|
notify => Service['apache'],
|
|
|
|
}
|
|
|
|
|
2014-09-09 14:45:04 +02:00
|
|
|
$cfgpath = '/etc/icingaweb'
|
|
|
|
|
2014-09-09 13:40:16 +02:00
|
|
|
file { [
|
2014-09-09 14:45:04 +02:00
|
|
|
"${cfgpath}",
|
|
|
|
"${cfgpath}/enabledModules",
|
|
|
|
"${cfgpath}/modules",
|
|
|
|
"${cfgpath}/modules/monitoring",
|
|
|
|
"${cfgpath}/modules/doc"
|
2014-09-09 13:40:16 +02:00
|
|
|
]:
|
2014-08-06 13:27:16 +02:00
|
|
|
ensure => 'directory',
|
|
|
|
owner => 'apache',
|
|
|
|
group => 'apache',
|
2014-09-10 11:45:57 +02:00
|
|
|
require => Class['apache'],
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|
|
|
|
|
2014-09-10 11:21:29 +02:00
|
|
|
icingaweb2::config::general { 'authentication':
|
2014-09-09 16:27:26 +02:00
|
|
|
source => 'puppet:///modules/icingaweb2_dev',
|
|
|
|
}
|
2014-08-06 13:27:16 +02:00
|
|
|
|
2014-09-10 11:21:29 +02:00
|
|
|
icingaweb2::config::general { [ 'resources', 'config' ]:
|
2014-09-09 15:15:53 +02:00
|
|
|
source => 'puppet:///modules/icingaweb2_dev',
|
|
|
|
replace => false,
|
2014-08-22 11:37:46 +02:00
|
|
|
}
|
|
|
|
|
2014-09-09 16:27:26 +02:00
|
|
|
icingaweb2::config::module { [ 'backends', 'config', 'instances' ]:
|
|
|
|
source => 'puppet:///modules/icingaweb2_dev',
|
|
|
|
}
|
2014-08-06 13:27:16 +02:00
|
|
|
}
|