mirror of https://github.com/Icinga/icinga2.git
Vagrant: Finalize Puppet provisioning.
This commit is contained in:
parent
38da492440
commit
aeb3e0a241
|
@ -1,6 +1,7 @@
|
||||||
include apache
|
include apache
|
||||||
include mysql
|
include mysql
|
||||||
include pgsql
|
# enable when icinga2-ido-pgsql is ready
|
||||||
|
#include pgsql
|
||||||
include epel
|
include epel
|
||||||
include icinga-rpm-snapshot
|
include icinga-rpm-snapshot
|
||||||
|
|
||||||
|
@ -15,6 +16,7 @@ exec { 'create-mysql-icinga2-ido-db':
|
||||||
require => Service['mysqld']
|
require => Service['mysqld']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# enable when icinga2-ido-pgsql is ready
|
||||||
#exec { 'create-pgsql-icinga2-ido-db':
|
#exec { 'create-pgsql-icinga2-ido-db':
|
||||||
# unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga\'" | grep -q 1',
|
# unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga\'" | grep -q 1',
|
||||||
# command => 'sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD \'icinga\';" && \
|
# command => 'sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD \'icinga\';" && \
|
||||||
|
@ -24,10 +26,16 @@ exec { 'create-mysql-icinga2-ido-db':
|
||||||
#}
|
#}
|
||||||
|
|
||||||
|
|
||||||
php::extension { ['php-mysql', 'php-pgsql']:
|
php::extension { ['php-mysql']:
|
||||||
require => [ Class['mysql'], Class['pgsql'] ]
|
require => [ Class['mysql'] ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# enable when icinga2-ido-pgsql is ready
|
||||||
|
#php::extension { ['php-pgsql']:
|
||||||
|
# require => [ Class['pgsql'] ]
|
||||||
|
#}
|
||||||
|
|
||||||
|
# runtime users
|
||||||
group { 'icinga-cmd':
|
group { 'icinga-cmd':
|
||||||
ensure => present
|
ensure => present
|
||||||
}
|
}
|
||||||
|
@ -43,17 +51,6 @@ user { 'apache':
|
||||||
require => [ Class['apache'], Group['icinga-cmd'] ]
|
require => [ Class['apache'], Group['icinga-cmd'] ]
|
||||||
}
|
}
|
||||||
|
|
||||||
cmmi { 'icinga-plugins':
|
|
||||||
url => 'https://www.nagios-plugins.org/download/nagios-plugins-1.5.tar.gz',
|
|
||||||
output => 'nagios-plugins-1.5.tar.gz',
|
|
||||||
flags => '--prefix=/usr/lib64/nagios/plugins \
|
|
||||||
--with-nagios-user=icinga --with-nagios-group=icinga \
|
|
||||||
--with-cgiurl=/icinga-mysql/cgi-bin',
|
|
||||||
creates => '/usr/lib64/nagios/plugins/libexec',
|
|
||||||
make => 'make && make install',
|
|
||||||
require => User['icinga']
|
|
||||||
}
|
|
||||||
|
|
||||||
file { '/etc/profile.d/env.sh':
|
file { '/etc/profile.d/env.sh':
|
||||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/profile.d/env.sh'
|
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/profile.d/env.sh'
|
||||||
}
|
}
|
||||||
|
@ -76,34 +73,43 @@ $icinga2_dev_packages = [ 'doxygen', 'openssl-devel',
|
||||||
'boost-test', 'boost-thread' ]
|
'boost-test', 'boost-thread' ]
|
||||||
package { $icinga2_dev_packages: ensure => installed }
|
package { $icinga2_dev_packages: ensure => installed }
|
||||||
|
|
||||||
#package { 'nagios-plugins-all':
|
# nagios plugins from epel
|
||||||
# ensure => installed
|
package { 'nagios-plugins-all':
|
||||||
#}
|
|
||||||
|
|
||||||
$icinga2_packages = [ 'icinga2', 'icinga2-doc', 'icinga2-ido-mysql', 'icinga2-classicui-config' ]
|
|
||||||
$icinga1_packages = [ 'icinga-gui' ]
|
|
||||||
|
|
||||||
package { $icinga2_packages:
|
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
|
require => Class['epel']
|
||||||
|
}
|
||||||
|
|
||||||
|
# these package require the icinga-rpm-snapshot repository installed
|
||||||
|
$icinga2_main_packages = [ 'icinga2', 'icinga2-doc', 'icinga2-ido-mysql', 'icinga-gui' ]
|
||||||
|
|
||||||
|
# workaround for package conflicts
|
||||||
|
# icinga-gui pulls icinga-gui-config automatically
|
||||||
|
package { 'icinga2-classicui-config':
|
||||||
|
ensure => installed,
|
||||||
|
before => Package["icinga-gui"],
|
||||||
require => Class['icinga-rpm-snapshot']
|
require => Class['icinga-rpm-snapshot']
|
||||||
}
|
}
|
||||||
package { $icinga1_packages:
|
|
||||||
|
package { $icinga2_main_packages:
|
||||||
ensure => installed,
|
ensure => installed,
|
||||||
require => Class['icinga-rpm-snapshot']
|
require => Class['icinga-rpm-snapshot']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# enable http 80
|
||||||
exec { 'iptables-allow-http':
|
exec { 'iptables-allow-http':
|
||||||
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 => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables'
|
command => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 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']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# users
|
||||||
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,
|
||||||
|
@ -115,6 +121,7 @@ user { 'vagrant':
|
||||||
require => Group['icinga-cmd']
|
require => Group['icinga-cmd']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# icinga2 service & features
|
||||||
service { 'icinga2':
|
service { 'icinga2':
|
||||||
enable => true,
|
enable => true,
|
||||||
ensure => running,
|
ensure => running,
|
||||||
|
|
|
@ -16,7 +16,7 @@ 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 => '0',
|
enabled => '1',
|
||||||
gpgcheck => '0',
|
gpgcheck => '0',
|
||||||
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
|
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue