icingaweb2/.vagrant-puppet/profiles/icingaweb2_dev/manifests/init.pp

65 lines
1.9 KiB
Puppet
Raw Normal View History

class icingaweb2_dev {
include apache
Exec { path => '/bin:/usr/bin' }
mysql::database::populate { 'icingaweb':
username => 'icingaweb',
password => 'icingaweb',
privileges => 'ALL',
schemafile => '/vagrant/etc/schema/accounts.mysql.sql',
}
pgsql::database::populate { 'icingaweb':
username => 'icingaweb',
password => 'icingaweb',
schemafile => '/vagrant/etc/schema/accounts.pgsql.sql',
}
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',
require => Mysql::Database::Populate['icingaweb'],
}
exec { 'populate-icingweb-pgsql-db-preferences':
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM preference;" &> /dev/null',
command => 'psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/preferences.pgsql.sql',
user => 'postgres',
require => Pgsql::Database::Populate['icingaweb'],
}
file { '/etc/httpd/conf.d/icingaweb.conf':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf',
notify => Service['apache'],
}
$cfgpath = '/etc/icingaweb'
file { [
"${cfgpath}",
"${cfgpath}/enabledModules",
"${cfgpath}/modules",
"${cfgpath}/modules/monitoring",
"${cfgpath}/modules/doc"
]:
ensure => 'directory',
owner => 'apache',
group => 'apache',
require => Class['apache'],
}
icingaweb2::config::general { 'authentication':
source => 'puppet:///modules/icingaweb2_dev',
}
icingaweb2::config::general { [ 'resources', 'config' ]:
source => 'puppet:///modules/icingaweb2_dev',
replace => false,
}
icingaweb2::config::module { [ 'backends', 'config', 'instances' ]:
source => 'puppet:///modules/icingaweb2_dev',
}
}