2013-05-29 18:23:55 +02:00
|
|
|
include apache
|
|
|
|
include mysql
|
|
|
|
include pgsql
|
2013-06-06 12:27:28 +02:00
|
|
|
include openldap
|
2013-05-29 18:23:55 +02:00
|
|
|
|
2014-09-01 15:13:18 +02:00
|
|
|
include icingaweb2
|
2014-08-29 11:46:15 +02:00
|
|
|
include nodejs
|
2014-09-02 12:11:36 +02:00
|
|
|
include icinga2_dev
|
2014-08-06 13:27:16 +02:00
|
|
|
|
2014-08-22 11:37:46 +02:00
|
|
|
Exec { path => '/bin:/usr/bin:/sbin:/usr/sbin' }
|
2013-05-29 18:23:55 +02:00
|
|
|
|
2014-08-05 13:50:23 +02:00
|
|
|
$icingaVersion = '1.11.5'
|
|
|
|
$icinga2Version = '2.0.1'
|
|
|
|
$livestatusVersion = '1.2.4p5'
|
|
|
|
$phantomjsVersion = '1.9.1'
|
|
|
|
$casperjsVersion = '1.0.2'
|
2014-01-28 15:54:13 +01:00
|
|
|
|
2014-08-06 13:27:16 +02:00
|
|
|
class { [
|
2014-09-02 12:11:36 +02:00
|
|
|
'icinga_mysql',
|
|
|
|
'icinga_pgsql' ]:
|
2014-08-06 13:27:16 +02:00
|
|
|
icingaVersion => $icingaVersion,
|
2013-05-29 18:23:55 +02:00
|
|
|
}
|
|
|
|
|
2014-08-05 11:17:17 +02:00
|
|
|
package { [
|
|
|
|
'gcc', 'glibc', 'glibc-common', 'gd', 'gd-devel',
|
2013-05-29 18:23:55 +02:00
|
|
|
'libpng', 'libpng-devel', 'net-snmp', 'net-snmp-devel', 'net-snmp-utils',
|
|
|
|
'libdbi', 'libdbi-devel', 'libdbi-drivers',
|
2014-08-05 11:17:17 +02:00
|
|
|
'libdbi-dbd-mysql', 'libdbi-dbd-pgsql' ]:
|
2014-08-18 11:00:30 +02:00
|
|
|
ensure => installed
|
2014-08-05 11:17:17 +02:00
|
|
|
}
|
2013-05-29 18:23:55 +02:00
|
|
|
|
2013-06-06 12:27:28 +02:00
|
|
|
php::extension { ['php-mysql', 'php-pgsql', 'php-ldap']:
|
2014-08-18 11:00:30 +02:00
|
|
|
require => [ Class['mysql'], Class['pgsql'], Class['openldap'] ]
|
2013-06-04 12:42:18 +02:00
|
|
|
}
|
2013-06-03 17:54:44 +02:00
|
|
|
|
2014-03-08 12:45:15 +01:00
|
|
|
php::extension { 'php-gd': }
|
|
|
|
|
2013-05-29 18:23:55 +02:00
|
|
|
group { 'icinga-cmd':
|
2014-08-18 11:00:30 +02:00
|
|
|
ensure => present
|
2013-05-29 18:23:55 +02:00
|
|
|
}
|
|
|
|
|
2014-05-09 13:25:16 +02:00
|
|
|
group { 'icingacmd':
|
|
|
|
ensure => present,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Package['icinga2']
|
2014-05-09 13:25:16 +02:00
|
|
|
}
|
|
|
|
|
2013-05-29 18:23:55 +02:00
|
|
|
user { 'icinga':
|
|
|
|
ensure => present,
|
|
|
|
groups => 'icinga-cmd',
|
2014-08-18 11:00:30 +02:00
|
|
|
managehome => false
|
2013-05-29 18:23:55 +02:00
|
|
|
}
|
|
|
|
|
2013-06-03 17:54:44 +02:00
|
|
|
user { 'apache':
|
2014-05-09 13:25:16 +02:00
|
|
|
groups => ['icinga-cmd', 'vagrant', 'icingacmd'],
|
2014-08-18 11:00:30 +02:00
|
|
|
require => [ Class['apache'], Group['icinga-cmd'], Group['icingacmd'] ]
|
2013-06-03 17:54:44 +02:00
|
|
|
}
|
|
|
|
|
2013-06-03 11:22:24 +02:00
|
|
|
exec { 'iptables-allow-http':
|
|
|
|
unless => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables',
|
2014-08-18 11:00:30 +02:00
|
|
|
command => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables'
|
2013-06-03 11:22:24 +02:00
|
|
|
}
|
2013-06-03 17:54:44 +02:00
|
|
|
|
|
|
|
exec { 'icinga-htpasswd':
|
|
|
|
creates => '/usr/share/icinga/htpasswd.users',
|
2014-07-02 08:39:49 +02:00
|
|
|
command => 'mkdir -p /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['apache']
|
2013-06-03 17:54:44 +02:00
|
|
|
}
|
2013-06-04 12:42:18 +02:00
|
|
|
|
2013-06-04 14:27:13 +02:00
|
|
|
cmmi { 'mk-livestatus':
|
2014-08-05 13:50:23 +02:00
|
|
|
url => "http://mathias-kettner.de/download/mk-livestatus-${livestatusVersion}.tar.gz",
|
|
|
|
output => "mk-livestatus-${livestatusVersion}.tar.gz",
|
2013-06-04 14:27:13 +02:00
|
|
|
flags => '--prefix=/usr/local/icinga-mysql --exec-prefix=/usr/local/icinga-mysql',
|
|
|
|
creates => '/usr/local/icinga-mysql/lib/mk-livestatus',
|
|
|
|
make => 'make && make install',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Cmmi['icinga-mysql']
|
2013-06-04 14:27:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/usr/local/icinga-mysql/etc/modules/mk-livestatus.cfg':
|
|
|
|
content => template('mk-livestatus/mk-livestatus.cfg.erb'),
|
|
|
|
owner => 'icinga',
|
|
|
|
group => 'icinga',
|
|
|
|
require => Cmmi['mk-livestatus'],
|
2014-08-18 11:00:30 +02:00
|
|
|
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ]
|
2013-06-04 14:27:13 +02:00
|
|
|
}
|
2013-06-06 12:27:28 +02:00
|
|
|
|
|
|
|
file { 'openldap/db.ldif':
|
|
|
|
path => '/usr/share/openldap-servers/db.ldif',
|
|
|
|
source => 'puppet:///modules/openldap/db.ldif',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['openldap']
|
2013-06-06 12:27:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { 'openldap/dit.ldif':
|
|
|
|
path => '/usr/share/openldap-servers/dit.ldif',
|
|
|
|
source => 'puppet:///modules/openldap/dit.ldif',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['openldap']
|
2013-06-06 12:27:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { 'openldap/users.ldif':
|
|
|
|
path => '/usr/share/openldap-servers/users.ldif',
|
|
|
|
source => 'puppet:///modules/openldap/users.ldif',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['openldap']
|
2013-06-06 12:27:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'populate-openldap':
|
|
|
|
# TODO: Split the command and use unless instead of trying to populate openldap everytime
|
|
|
|
command => 'sudo ldapadd -c -Y EXTERNAL -H ldapi:/// -f /usr/share/openldap-servers/db.ldif || true && \
|
|
|
|
sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/dit.ldif || true && \
|
|
|
|
sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/users.ldif || true',
|
2013-08-13 13:39:57 +02:00
|
|
|
require => [ Service['slapd'], File['openldap/db.ldif'],
|
2014-08-18 11:00:30 +02:00
|
|
|
File['openldap/dit.ldif'], File['openldap/users.ldif'] ]
|
2013-06-06 12:27:28 +02:00
|
|
|
}
|
2013-06-06 14:36:20 +02:00
|
|
|
|
|
|
|
class { 'phantomjs':
|
2014-08-05 13:50:23 +02:00
|
|
|
url => "https://phantomjs.googlecode.com/files/phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2",
|
|
|
|
output => "phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2",
|
2014-08-18 11:00:30 +02:00
|
|
|
creates => '/usr/local/phantomjs'
|
2013-06-06 14:36:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class { 'casperjs':
|
2014-08-05 13:50:23 +02:00
|
|
|
url => "https://github.com/n1k0/casperjs/tarball/${casperjsVersion}",
|
|
|
|
output => "casperjs-${casperjsVersion}.tar.gz",
|
2014-08-18 11:00:30 +02:00
|
|
|
creates => '/usr/local/casperjs'
|
2013-06-06 14:36:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/profile.d/env.sh':
|
2014-08-18 11:00:30 +02:00
|
|
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/profile.d/env.sh'
|
2013-06-06 14:36:20 +02:00
|
|
|
}
|
2013-06-06 16:09:28 +02:00
|
|
|
|
2013-06-06 16:48:15 +02:00
|
|
|
include epel
|
|
|
|
|
|
|
|
exec { 'install PHPUnit':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-phpunit-PHPUnit',
|
|
|
|
unless => 'rpm -qa | grep php-phpunit-PHPUnit',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['epel']
|
2013-06-06 16:48:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'install PHP CodeSniffer':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-pear-PHP-CodeSniffer',
|
|
|
|
unless => 'rpm -qa | grep php-pear-PHP-CodeSniffer',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['epel']
|
2013-06-06 16:48:15 +02:00
|
|
|
}
|
|
|
|
|
2014-01-28 15:54:13 +01:00
|
|
|
exec { 'install php-ZendFramework':
|
2013-06-06 17:01:05 +02:00
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework',
|
|
|
|
unless => 'rpm -qa | grep php-ZendFramework',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['epel']
|
2013-06-06 17:01:05 +02:00
|
|
|
}
|
2013-06-10 11:03:10 +02:00
|
|
|
|
2014-01-28 15:54:13 +01:00
|
|
|
package { ['cmake', 'boost-devel', 'bison', 'flex']:
|
2014-08-18 11:00:30 +02:00
|
|
|
ensure => installed
|
2013-06-10 11:03:10 +02:00
|
|
|
}
|
|
|
|
|
2014-06-04 16:09:50 +02:00
|
|
|
# icinga 2
|
2014-05-09 13:25:16 +02:00
|
|
|
yumrepo { 'icinga2-repo':
|
2014-05-09 15:37:34 +02:00
|
|
|
baseurl => "http://packages.icinga.org/epel/6/snapshot/",
|
2014-06-04 16:09:50 +02:00
|
|
|
enabled => '1',
|
2014-05-09 13:25:16 +02:00
|
|
|
gpgcheck => '1',
|
|
|
|
gpgkey => 'http://packages.icinga.org/icinga.key',
|
2014-08-18 11:00:30 +02:00
|
|
|
descr => "Icinga Repository - ${::architecture}"
|
2014-05-09 13:25:16 +02:00
|
|
|
}
|
|
|
|
|
2014-06-04 16:09:50 +02:00
|
|
|
exec { 'install nagios-plugins-all':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install nagios-plugins-all',
|
|
|
|
unless => 'rpm -qa | grep nagios-plugins-all',
|
|
|
|
require => [ Class['epel'], Package['icinga2'] ],
|
2014-05-09 13:25:16 +02:00
|
|
|
}
|
2014-09-02 12:11:36 +02:00
|
|
|
# vs include monitoring_plugins (epel is disabled)
|
2014-08-22 11:37:46 +02:00
|
|
|
|
2014-05-09 13:25:16 +02:00
|
|
|
|
2014-06-04 16:09:50 +02:00
|
|
|
# icinga 2 classic ui
|
|
|
|
package { 'icinga-gui':
|
|
|
|
ensure => latest,
|
|
|
|
require => Yumrepo['icinga2-repo'],
|
2014-08-18 11:00:30 +02:00
|
|
|
alias => 'icinga-gui'
|
2014-06-04 16:09:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# icinga 2 ido mysql
|
|
|
|
|
|
|
|
|
|
|
|
# icinga 2 test config
|
2014-05-09 13:25:16 +02:00
|
|
|
|
|
|
|
|
2013-06-28 13:45:13 +02:00
|
|
|
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Mysql',
|
|
|
|
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Mysql',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Exec['install php-ZendFramework']
|
2013-06-28 13:45:13 +02:00
|
|
|
}
|
|
|
|
|
2013-06-28 16:13:44 +02:00
|
|
|
file { '/etc/motd':
|
2013-08-16 12:00:16 +02:00
|
|
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
|
2013-08-19 14:14:50 +02:00
|
|
|
owner => root,
|
2014-08-18 11:00:30 +02:00
|
|
|
group => root
|
2013-06-28 16:13:44 +02:00
|
|
|
}
|
2013-07-23 14:46:57 +02:00
|
|
|
|
|
|
|
user { 'vagrant':
|
|
|
|
groups => 'icinga-cmd',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Group['icinga-cmd']
|
2013-07-23 14:46:57 +02:00
|
|
|
}
|
2013-07-29 18:35:40 +02:00
|
|
|
|
2014-08-05 16:16:05 +02:00
|
|
|
mysql::database::create { 'icinga_unittest':
|
|
|
|
username => 'icinga_unittest',
|
|
|
|
password => 'icinga_unittest',
|
|
|
|
privileges => 'ALL',
|
2013-07-29 18:35:40 +02:00
|
|
|
}
|
|
|
|
|
2014-08-05 15:15:46 +02:00
|
|
|
pgsql::database::create { 'icinga_unittest':
|
|
|
|
username => 'icinga_unittest',
|
|
|
|
password => 'icinga_unittest',
|
2013-07-29 18:35:40 +02:00
|
|
|
}
|
2013-07-29 18:36:25 +02:00
|
|
|
|
|
|
|
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Pgsql',
|
|
|
|
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Pgsql',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Exec['install php-ZendFramework']
|
2013-07-29 18:36:25 +02:00
|
|
|
}
|
2013-08-13 10:17:44 +02:00
|
|
|
|
2013-08-13 11:23:42 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Following section installs the Perl module Monitoring::Generator::TestConfig in order to create test config to
|
|
|
|
# */usr/local/share/misc/monitoring_test_config*. Then the config is copied to *<instance>/etc/conf.d/test_config/* of
|
|
|
|
# both the MySQL and PostgreSQL Icinga instance
|
|
|
|
#
|
2013-08-13 10:17:44 +02:00
|
|
|
cpan { 'Monitoring::Generator::TestConfig':
|
|
|
|
creates => '/usr/local/share/perl5/Monitoring/Generator/TestConfig.pm',
|
2014-08-18 11:00:30 +02:00
|
|
|
timeout => 600
|
2013-08-13 10:17:44 +02:00
|
|
|
}
|
2013-08-13 11:23:42 +02:00
|
|
|
|
|
|
|
exec { 'create_monitoring_test_config':
|
|
|
|
command => 'sudo install -o root -g root -d /usr/local/share/misc/ && \
|
|
|
|
sudo /usr/local/bin/create_monitoring_test_config.pl -l icinga \
|
|
|
|
/usr/local/share/misc/monitoring_test_config',
|
2013-08-14 14:35:37 +02:00
|
|
|
creates => '/usr/local/share/misc/monitoring_test_config',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Cpan['Monitoring::Generator::TestConfig']
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
define populate_monitoring_test_config {
|
|
|
|
file { "/usr/local/icinga-mysql/etc/conf.d/test_config/${name}.cfg":
|
|
|
|
owner => 'icinga',
|
|
|
|
group => 'icinga',
|
|
|
|
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
2014-08-18 11:00:30 +02:00
|
|
|
notify => Service['icinga-mysql']
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
|
|
|
file { "/usr/local/icinga-pgsql/etc/conf.d/test_config/${name}.cfg":
|
|
|
|
owner => 'icinga',
|
|
|
|
group => 'icinga',
|
|
|
|
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
2014-08-18 11:00:30 +02:00
|
|
|
notify => Service['icinga-pgsql']
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-14 14:35:37 +02:00
|
|
|
file { '/usr/local/icinga-mysql/etc/conf.d/test_config/':
|
2013-08-13 11:23:42 +02:00
|
|
|
ensure => directory,
|
|
|
|
owner => icinga,
|
|
|
|
group => icinga,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Cmmi['icinga-mysql']
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
|
|
|
|
2013-08-14 14:35:37 +02:00
|
|
|
file { '/usr/local/icinga-pgsql/etc/conf.d/test_config/':
|
2013-08-13 11:23:42 +02:00
|
|
|
ensure => directory,
|
|
|
|
owner => icinga,
|
|
|
|
group => icinga,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Cmmi['icinga-pgsql']
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
populate_monitoring_test_config { ['commands', 'contacts', 'dependencies',
|
|
|
|
'hostgroups', 'hosts', 'servicegroups', 'services']:
|
2013-08-13 13:39:57 +02:00
|
|
|
require => [ Exec['create_monitoring_test_config'],
|
|
|
|
File['/usr/local/icinga-mysql/etc/conf.d/test_config/'],
|
|
|
|
File['/usr/local/icinga-pgsql/etc/conf.d/test_config/'] ]
|
|
|
|
}
|
|
|
|
|
|
|
|
define populate_monitoring_test_config_plugins {
|
|
|
|
file { "/usr/lib64/nagios/plugins/libexec/${name}":
|
|
|
|
owner => 'icinga',
|
|
|
|
group => 'icinga',
|
|
|
|
source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}",
|
2014-08-18 11:00:30 +02:00
|
|
|
notify => [ Service['icinga-mysql'], Service['icinga-pgsql'] ]
|
2013-08-13 13:39:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
populate_monitoring_test_config_plugins{ ['test_hostcheck.pl', 'test_servicecheck.pl']:
|
|
|
|
require => [ Exec['create_monitoring_test_config'],
|
|
|
|
Cmmi['icinga-mysql'],
|
|
|
|
Cmmi['icinga-pgsql'] ]
|
2013-08-13 11:23:42 +02:00
|
|
|
}
|
2013-08-14 17:37:17 +02:00
|
|
|
|
|
|
|
#
|
2013-10-23 15:10:33 +02:00
|
|
|
# Following section creates and populates MySQL and PostgreSQL Icinga Web 2 databases
|
2013-08-14 17:37:17 +02:00
|
|
|
#
|
2013-08-16 12:00:16 +02:00
|
|
|
|
|
|
|
|
2013-08-15 11:55:20 +02:00
|
|
|
#
|
|
|
|
# Following section creates the Icinga command proxy to /usr/local/icinga-mysql/var/rw/icinga.cmd (which is the
|
|
|
|
# config's default path for the Icinga command pipe) in order to send commands to both the MySQL and PostgreSQL instance
|
|
|
|
#
|
|
|
|
file { [ '/usr/local/icinga/', '/usr/local/icinga/var/', '/usr/local/icinga/var/rw/' ]:
|
|
|
|
ensure => directory,
|
|
|
|
owner => icinga,
|
|
|
|
group => icinga,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => User['icinga']
|
2013-08-15 11:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/usr/local/bin/icinga_command_proxy':
|
|
|
|
source => 'puppet:////vagrant/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy',
|
|
|
|
owner => root,
|
|
|
|
group => root,
|
2014-08-18 11:00:30 +02:00
|
|
|
mode => 755
|
2013-08-15 11:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/init.d/icinga_command_proxy':
|
|
|
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/init.d/icinga_command_proxy',
|
|
|
|
owner => root,
|
|
|
|
group => root,
|
|
|
|
mode => 755,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => File['/usr/local/bin/icinga_command_proxy']
|
2013-08-15 11:55:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
service { 'icinga_command_proxy':
|
|
|
|
ensure => running,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => [ File['/etc/init.d/icinga_command_proxy'], Service['icinga-mysql'], Service['icinga-pgsql'] ]
|
2013-08-15 11:55:20 +02:00
|
|
|
}
|
2013-10-23 12:43:49 +02:00
|
|
|
|
2014-08-05 16:29:44 +02:00
|
|
|
mysql::database::create { 'icinga_web':
|
|
|
|
username => 'icinga_web',
|
|
|
|
password => 'icinga_web',
|
|
|
|
privileges => 'ALL',
|
2013-10-23 12:43:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
cmmi { 'icinga-web':
|
|
|
|
url => 'http://sourceforge.net/projects/icinga/files/icinga-web/1.10.0-beta/icinga-web-1.10.0-beta.tar.gz/download',
|
|
|
|
output => 'icinga-web-1.10.0-beta.tar.gz',
|
|
|
|
flags => '--prefix=/usr/local/icinga-web',
|
|
|
|
creates => '/usr/local/icinga-web',
|
|
|
|
make => 'make install && make install-apache-config',
|
|
|
|
require => Service['icinga_command_proxy'],
|
2014-08-18 11:00:30 +02:00
|
|
|
notify => Service['apache']
|
2013-10-23 12:43:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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/local/src/icinga-web/icinga-web-1.10.0-beta/etc/schema/mysql.sql',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => [ Exec['create-mysql-icinga_web-db'], Cmmi['icinga-web'] ]
|
2013-10-23 12:43:49 +02:00
|
|
|
}
|
2014-02-18 16:41:53 +01:00
|
|
|
|
|
|
|
file { '/var/www/html/icingaweb':
|
2014-03-27 08:25:53 +01:00
|
|
|
ensure => absent,
|
2014-03-04 16:22:37 +01:00
|
|
|
}
|
|
|
|
|
2014-05-09 13:25:16 +02:00
|
|
|
# pear::package { 'deepend/Mockery':
|
2014-08-18 11:00:30 +02:00
|
|
|
# channel => 'pear.survivethedeepend.com'
|
2014-05-09 13:25:16 +02:00
|
|
|
# }
|
2014-05-23 15:26:46 +02:00
|
|
|
|
|
|
|
# icingacli
|
|
|
|
file { '/usr/local/bin/icingacli':
|
|
|
|
ensure => 'link',
|
|
|
|
target => '/vagrant/bin/icingacli',
|
|
|
|
owner => 'apache',
|
|
|
|
group => 'apache',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => [ File['/etc/icingaweb'], File['/etc/bash_completion.d/icingacli'] ]
|
2014-05-23 15:26:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
exec { 'install bash-completion':
|
|
|
|
command => 'yum -d 0 -e 0 -y --enablerepo=epel install bash-completion',
|
|
|
|
unless => 'rpm -qa | grep bash-completion',
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Class['epel']
|
2014-05-23 15:26:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
file { '/etc/bash_completion.d/icingacli':
|
|
|
|
source => 'puppet:////vagrant/etc/bash_completion.d/icingacli',
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => 755,
|
2014-08-18 11:00:30 +02:00
|
|
|
require => Exec['install bash-completion']
|
2014-05-23 15:26:46 +02:00
|
|
|
}
|
|
|
|
|