mirror of https://github.com/Icinga/icinga2.git
Clean up the Puppet files.
This commit is contained in:
parent
152e33ea89
commit
d7801f22e9
|
@ -10,13 +10,13 @@ include nagios-plugins
|
||||||
|
|
||||||
# icinga 2 docs at /icinga2-doc
|
# icinga 2 docs at /icinga2-doc
|
||||||
file { '/etc/httpd/conf.d/icinga2-doc.conf':
|
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'] ],
|
require => [ Package['apache'], Package['icinga2-doc'] ],
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/motd':
|
file { '/etc/motd':
|
||||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
|
||||||
owner => root,
|
owner => root,
|
||||||
group => root
|
group => root
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,19 +20,19 @@ class apache {
|
||||||
|
|
||||||
package { $apache:
|
package { $apache:
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
alias => 'apache'
|
alias => 'apache'
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'iptables-allow-http':
|
exec { 'iptables-allow-http':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
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',
|
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'
|
command => 'lokkit --enabled --service=http'
|
||||||
}
|
}
|
||||||
|
|
||||||
service { $apache:
|
service { $apache:
|
||||||
enable => true,
|
enable => true,
|
||||||
ensure => running,
|
ensure => running,
|
||||||
alias => 'apache',
|
alias => 'apache',
|
||||||
require => [ Package['apache'], Exec['iptables-allow-http'] ]
|
require => [ Package['apache'], Exec['iptables-allow-http'] ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ define cpan(
|
||||||
}
|
}
|
||||||
|
|
||||||
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
|
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
|
||||||
ensure => directory
|
ensure => directory
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/root/.cpan/CPAN/MyConfig.pm':
|
file { '/root/.cpan/CPAN/MyConfig.pm':
|
||||||
|
|
|
@ -15,10 +15,10 @@
|
||||||
class epel {
|
class epel {
|
||||||
yumrepo { 'epel':
|
yumrepo { 'epel':
|
||||||
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
|
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
|
||||||
enabled => '1',
|
enabled => '1',
|
||||||
gpgcheck => '1',
|
gpgcheck => '1',
|
||||||
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
|
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6',
|
||||||
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
|
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6":
|
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6":
|
||||||
|
|
|
@ -12,7 +12,7 @@ class icinga-classicui {
|
||||||
|
|
||||||
package { 'icinga-gui':
|
package { 'icinga-gui':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
alias => 'icinga-gui'
|
alias => 'icinga-gui'
|
||||||
}
|
}
|
||||||
|
|
||||||
# runtime users
|
# runtime users
|
||||||
|
@ -32,11 +32,11 @@ class icinga-classicui {
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'enable-icinga2-features':
|
exec { 'enable-icinga2-features':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
command => 'i2enfeature statusdat; \
|
command => 'i2enfeature statusdat; \
|
||||||
i2enfeature compat-log; \
|
i2enfeature compat-log; \
|
||||||
i2enfeature command;',
|
i2enfeature command;',
|
||||||
require => [ Package['icinga2'] ],
|
require => [ Package['icinga2'] ],
|
||||||
notify => Service['icinga2']
|
notify => Service['icinga2']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,11 +16,11 @@ class icinga-rpm-snapshot {
|
||||||
yumrepo { 'icinga-rpm-snapshot':
|
yumrepo { 'icinga-rpm-snapshot':
|
||||||
mirrorlist => "http://packages.icinga.org/epel/6/snapshot/ICINGA-snapshot.repo",
|
mirrorlist => "http://packages.icinga.org/epel/6/snapshot/ICINGA-snapshot.repo",
|
||||||
# baseurl is required, otherwise mirrorlist errors by yum
|
# baseurl is required, otherwise mirrorlist errors by yum
|
||||||
baseurl => "http://packages.icinga.org/epel/6/snapshot/",
|
baseurl => "http://packages.icinga.org/epel/6/snapshot/",
|
||||||
enabled => '1',
|
enabled => '1',
|
||||||
gpgcheck => '1',
|
gpgcheck => '1',
|
||||||
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA',
|
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA',
|
||||||
descr => "Icinga Snapshot Packages for Enterprise Linux 6 - ${::architecture}"
|
descr => "Icinga Snapshot Packages for Enterprise Linux 6 - ${::architecture}"
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA":
|
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-ICINGA":
|
||||||
|
|
|
@ -8,12 +8,12 @@ class icinga-web {
|
||||||
package { 'icinga-web':
|
package { 'icinga-web':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
require => Class['icinga-rpm-snapshot'],
|
require => Class['icinga-rpm-snapshot'],
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'create-mysql-icinga-web-db':
|
exec { 'create-mysql-icinga-web-db':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
unless => 'mysql -uicinga_web -picinga_web icinga_web',
|
unless => 'mysql -uicinga_web -picinga_web icinga_web',
|
||||||
command => 'mysql -uroot -e "CREATE DATABASE icinga_web; \
|
command => 'mysql -uroot -e "CREATE DATABASE icinga_web; \
|
||||||
GRANT ALL ON icinga_web.* TO icinga_web@localhost \
|
GRANT ALL ON icinga_web.* TO icinga_web@localhost \
|
||||||
IDENTIFIED BY \'icinga_web\';"',
|
IDENTIFIED BY \'icinga_web\';"',
|
||||||
|
@ -21,8 +21,8 @@ class icinga-web {
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'populate-icinga-web-mysql-db':
|
exec { 'populate-icinga-web-mysql-db':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
unless => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null',
|
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',
|
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'] ]
|
require => [ Package['icinga-web'], Exec['create-mysql-icinga-web-db'] ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ class icinga2 {
|
||||||
package { 'icinga2':
|
package { 'icinga2':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
require => Class['icinga-rpm-snapshot'],
|
require => Class['icinga-rpm-snapshot'],
|
||||||
alias => 'icinga2'
|
alias => 'icinga2'
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'icinga2-doc':
|
package { 'icinga2-doc':
|
||||||
|
@ -14,9 +14,10 @@ class icinga2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'icinga2':
|
service { 'icinga2':
|
||||||
enable => true,
|
enable => true,
|
||||||
ensure => running,
|
ensure => running,
|
||||||
alias => 'icinga2',
|
hasrestart => true,
|
||||||
|
alias => 'icinga2',
|
||||||
require => Package['icinga2']
|
require => Package['icinga2']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,21 +37,21 @@ class icinga2-ido-mysql {
|
||||||
|
|
||||||
# icinga 2 IDO config
|
# icinga 2 IDO config
|
||||||
file { '/etc/icinga2/features-available/ido-mysql.conf':
|
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'],
|
require => Package['icinga2'],
|
||||||
notify => Service['icinga2']
|
notify => Service['icinga2']
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'enable-icinga2-ido-mysql':
|
exec { 'enable-icinga2-ido-mysql':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
command => 'i2enfeature ido-mysql;',
|
command => 'i2enfeature ido-mysql;',
|
||||||
require => [ Package['icinga2'], Exec['populate-icinga2-ido-mysql-db'] ],
|
require => [ Package['icinga2'], Exec['populate-icinga2-ido-mysql-db'] ],
|
||||||
notify => Service['icinga2']
|
notify => Service['icinga2']
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'create-mysql-icinga2-ido-db':
|
exec { 'create-mysql-icinga2-ido-db':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
unless => 'mysql -uicinga -picinga icinga',
|
unless => 'mysql -uicinga -picinga icinga',
|
||||||
command => 'mysql -uroot -e "CREATE DATABASE icinga; \
|
command => 'mysql -uroot -e "CREATE DATABASE icinga; \
|
||||||
GRANT ALL ON icinga.* TO icinga@localhost \
|
GRANT ALL ON icinga.* TO icinga@localhost \
|
||||||
IDENTIFIED BY \'icinga\';"',
|
IDENTIFIED BY \'icinga\';"',
|
||||||
|
@ -59,8 +60,8 @@ class icinga2-ido-mysql {
|
||||||
|
|
||||||
# populate icinga2-ido-mysql db
|
# populate icinga2-ido-mysql db
|
||||||
exec { 'populate-icinga2-ido-mysql-db':
|
exec { 'populate-icinga2-ido-mysql-db':
|
||||||
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
path => '/bin:/usr/bin:/sbin:/usr/sbin',
|
||||||
unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
|
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',
|
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'] ]
|
require => [ Package['icinga2-ido-mysql'], Exec['create-mysql-icinga2-ido-db'] ]
|
||||||
}
|
}
|
||||||
|
@ -70,7 +71,7 @@ class icinga2-ido-mysql {
|
||||||
# include icinga-rpm-snapshot
|
# include icinga-rpm-snapshot
|
||||||
#
|
#
|
||||||
# package { 'icinga2-ido-pgsql':
|
# package { 'icinga2-ido-pgsql':
|
||||||
# ensure => installed,
|
# ensure => installed,
|
||||||
# require => Class['icinga-rpm-snapshot'],
|
# require => Class['icinga-rpm-snapshot'],
|
||||||
# alias = 'icinga2-ido-pgsql'
|
# alias = 'icinga2-ido-pgsql'
|
||||||
# }
|
# }
|
||||||
|
@ -84,7 +85,7 @@ class icinga2-ido-mysql {
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
# exec { 'populate-icinga2-ido-pgsql-db':
|
# 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',
|
# 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'] ]
|
# require => [ Package['icinga2-ido-pgsql'], Exec['create-pgsql-icinga2-ido-db'] ]
|
||||||
# }
|
# }
|
||||||
|
|
|
@ -24,14 +24,14 @@ class mysql {
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'mysqld':
|
service { 'mysqld':
|
||||||
enable => true,
|
enable => true,
|
||||||
ensure => running,
|
ensure => running,
|
||||||
require => Package['mysql-server']
|
require => Package['mysql-server']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/my.cnf':
|
file { '/etc/my.cnf':
|
||||||
content => template('mysql/my.cnf.erb'),
|
content => template('mysql/my.cnf.erb'),
|
||||||
require => Package['mysql-server'],
|
require => Package['mysql-server'],
|
||||||
notify => Service['mysqld']
|
notify => Service['mysqld']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Class: pgsql
|
# Class: pgsql
|
||||||
#
|
#
|
||||||
# This class installs the postgresql server and client software.
|
# 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:
|
# Parameters:
|
||||||
#
|
#
|
||||||
|
@ -31,13 +31,13 @@ class pgsql {
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'postgresql':
|
service { 'postgresql':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
require => [Package['postgresql-server'], Exec['initdb']]
|
require => [Package['postgresql-server'], Exec['initdb']]
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/var/lib/pgsql/data/pg_hba.conf':
|
file { '/var/lib/pgsql/data/pg_hba.conf':
|
||||||
content => template('pgsql/pg_hba.conf.erb'),
|
content => template('pgsql/pg_hba.conf.erb'),
|
||||||
require => [Package['postgresql-server'], Exec['initdb']],
|
require => [Package['postgresql-server'], Exec['initdb']],
|
||||||
notify => Service['postgresql']
|
notify => Service['postgresql']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ define php::extension(
|
||||||
}
|
}
|
||||||
|
|
||||||
package { $name:
|
package { $name:
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
require => $require_,
|
require => $require_,
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,20 +19,20 @@ class php {
|
||||||
include apache
|
include apache
|
||||||
|
|
||||||
package { 'php':
|
package { 'php':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
require => Package['apache'],
|
require => Package['apache'],
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/php.d/error_reporting.ini':
|
file { '/etc/php.d/error_reporting.ini':
|
||||||
content => template('php/error_reporting.ini.erb'),
|
content => template('php/error_reporting.ini.erb'),
|
||||||
require => Package['php'],
|
require => Package['php'],
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/php.d/xdebug_settings.ini':
|
file { '/etc/php.d/xdebug_settings.ini':
|
||||||
content => template('php/xdebug_settings.ini.erb'),
|
content => template('php/xdebug_settings.ini.erb'),
|
||||||
require => Package['php'],
|
require => Package['php'],
|
||||||
notify => Service['apache']
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
# include wget
|
# include wget
|
||||||
#
|
#
|
||||||
class wget {
|
class wget {
|
||||||
|
|
||||||
package { 'wget':
|
package { 'wget':
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue