# icinga 2 docs at /icinga2-doc
file { '/etc/httpd/conf.d/icinga2-doc.conf':
- source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-doc.conf',
+ source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-doc.conf',
require => [ Package['apache'], Package['icinga2-doc'] ],
- notify => Service['apache']
+ notify => Service['apache']
}
file { '/etc/motd':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
- owner => root,
- group => root
+ owner => root,
+ group => root
}
package { $apache:
ensure => installed,
- alias => 'apache'
+ alias => 'apache'
}
exec { 'iptables-allow-http':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
- unless => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ unless => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables',
command => 'lokkit --enabled --service=http'
}
service { $apache:
- enable => true,
- ensure => running,
- alias => 'apache',
+ enable => true,
+ ensure => running,
+ alias => 'apache',
require => [ Package['apache'], Exec['iptables-allow-http'] ]
}
}
}
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
- ensure => directory
+ ensure => directory
}
file { '/root/.cpan/CPAN/MyConfig.pm':
class epel {
yumrepo { 'epel':
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
- enabled => '1',
- gpgcheck => '1',
- gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
- descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
+ enabled => '1',
+ gpgcheck => '1',
+ gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
+ descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6":
package { 'icinga-gui':
ensure => installed,
- alias => 'icinga-gui'
+ alias => 'icinga-gui'
}
# runtime users
}
exec { 'enable-icinga2-features':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'i2enfeature statusdat; \
i2enfeature compat-log; \
i2enfeature command;',
require => [ Package['icinga2'] ],
- notify => Service['icinga2']
+ notify => Service['icinga2']
}
}
yumrepo { 'icinga-rpm-snapshot':
mirrorlist => "http://packages.icinga.org/epel/6/snapshot/ICINGA-snapshot.repo",
# baseurl is required, otherwise mirrorlist errors by yum
- baseurl => "http://packages.icinga.org/epel/6/snapshot/",
- enabled => '1',
- gpgcheck => '1',
- gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA',
- descr => "Icinga Snapshot Packages for Enterprise Linux 6 - ${::architecture}"
+ baseurl => "http://packages.icinga.org/epel/6/snapshot/",
+ enabled => '1',
+ gpgcheck => '1',
+ gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA',
+ descr => "Icinga Snapshot Packages for Enterprise Linux 6 - ${::architecture}"
}
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA":
package { 'icinga-web':
ensure => installed,
require => Class['icinga-rpm-snapshot'],
- notify => Service['apache']
+ notify => Service['apache']
}
exec { 'create-mysql-icinga-web-db':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
- unless => 'mysql -uicinga_web -picinga_web icinga_web',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ 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\';"',
}
exec { 'populate-icinga-web-mysql-db':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
- unless => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ 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'] ]
}
package { 'icinga2':
ensure => installed,
require => Class['icinga-rpm-snapshot'],
- alias => 'icinga2'
+ alias => 'icinga2'
}
package { 'icinga2-doc':
}
service { 'icinga2':
- enable => true,
- ensure => running,
- alias => 'icinga2',
+ enable => true,
+ ensure => running,
+ hasrestart => true,
+ alias => 'icinga2',
require => Package['icinga2']
}
# icinga 2 IDO config
file { '/etc/icinga2/features-available/ido-mysql.conf':
- source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf',
+ source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf',
require => Package['icinga2'],
- notify => Service['icinga2']
+ notify => Service['icinga2']
}
exec { 'enable-icinga2-ido-mysql':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => 'i2enfeature ido-mysql;',
require => [ Package['icinga2'], Exec['populate-icinga2-ido-mysql-db'] ],
- notify => Service['icinga2']
+ notify => Service['icinga2']
}
exec { 'create-mysql-icinga2-ido-db':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
- unless => 'mysql -uicinga -picinga icinga',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ unless => 'mysql -uicinga -picinga icinga',
command => 'mysql -uroot -e "CREATE DATABASE icinga; \
GRANT ALL ON icinga.* TO icinga@localhost \
IDENTIFIED BY \'icinga\';"',
# populate icinga2-ido-mysql db
exec { 'populate-icinga2-ido-mysql-db':
- path => '/bin:/usr/bin:/sbin:/usr/sbin',
- unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
+ path => '/bin:/usr/bin:/sbin:/usr/sbin',
+ unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
command => 'mysql -uicinga -picinga icinga < /usr/share/doc/icinga2-ido-mysql-$(rpm -q icinga2-ido-mysql | cut -d\'-\' -f4)/schema/mysql.sql',
require => [ Package['icinga2-ido-mysql'], Exec['create-mysql-icinga2-ido-db'] ]
}
# include icinga-rpm-snapshot
#
# package { 'icinga2-ido-pgsql':
-# ensure => installed,
+# ensure => installed,
# require => Class['icinga-rpm-snapshot'],
# alias = 'icinga2-ido-pgsql'
# }
# }
#
# exec { 'populate-icinga2-ido-pgsql-db':
-# unless => 'psql -U icinga -d icinga -c "SELECT * FROM icinga_dbversion;" &> /dev/null',
+# unless => 'psql -U icinga -d icinga -c "SELECT * FROM icinga_dbversion;" &> /dev/null',
# command => 'sudo -u postgres psql -U icinga -d icinga < /usr/share/doc/icinga2-ido-pgsql-$(rpm -q icinga2-ido-mysql | cut -d\'-\' -f4)/schema/pgsql.sql',
# require => [ Package['icinga2-ido-pgsql'], Exec['create-pgsql-icinga2-ido-db'] ]
# }
}
service { 'mysqld':
- enable => true,
- ensure => running,
+ enable => true,
+ ensure => running,
require => Package['mysql-server']
}
file { '/etc/my.cnf':
content => template('mysql/my.cnf.erb'),
require => Package['mysql-server'],
- notify => Service['mysqld']
+ notify => Service['mysqld']
}
}
# Class: pgsql
#
# This class installs the postgresql server and client software.
-# Further it configures pg_hba.conf to trus the local icinga user.
+# Further it configures pg_hba.conf to trust the local icinga user.
#
# Parameters:
#
}
service { 'postgresql':
- ensure => running,
+ ensure => running,
require => [Package['postgresql-server'], Exec['initdb']]
}
file { '/var/lib/pgsql/data/pg_hba.conf':
content => template('pgsql/pg_hba.conf.erb'),
require => [Package['postgresql-server'], Exec['initdb']],
- notify => Service['postgresql']
+ notify => Service['postgresql']
}
}
}
package { $name:
- ensure => $ensure,
+ ensure => $ensure,
require => $require_,
- notify => Service['apache']
+ notify => Service['apache']
}
}
include apache
package { 'php':
- ensure => installed,
+ ensure => installed,
require => Package['apache'],
- notify => Service['apache']
+ notify => Service['apache']
}
file { '/etc/php.d/error_reporting.ini':
content => template('php/error_reporting.ini.erb'),
require => Package['php'],
- notify => Service['apache']
+ notify => Service['apache']
}
file { '/etc/php.d/xdebug_settings.ini':
content => template('php/xdebug_settings.ini.erb'),
require => Package['php'],
- notify => Service['apache']
+ notify => Service['apache']
}
}
# include wget
#
class wget {
-
package { 'wget':
- ensure => installed,
+ ensure => installed,
}
}