From aeb3e0a2414a843daa9be18993a571754565caf2 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Sun, 13 Oct 2013 19:20:43 +0200 Subject: [PATCH] Vagrant: Finalize Puppet provisioning. --- .vagrant-puppet/manifests/default.pp | 49 +++++++++++-------- .../modules/epel/manifests/init.pp | 2 +- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 259a82378..16ecb16af 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -1,6 +1,7 @@ include apache include mysql -include pgsql +# enable when icinga2-ido-pgsql is ready +#include pgsql include epel include icinga-rpm-snapshot @@ -15,6 +16,7 @@ exec { 'create-mysql-icinga2-ido-db': require => Service['mysqld'] } +# enable when icinga2-ido-pgsql is ready #exec { 'create-pgsql-icinga2-ido-db': # 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\';" && \ @@ -24,10 +26,16 @@ exec { 'create-mysql-icinga2-ido-db': #} -php::extension { ['php-mysql', 'php-pgsql']: - require => [ Class['mysql'], Class['pgsql'] ] +php::extension { ['php-mysql']: + require => [ Class['mysql'] ] } +# enable when icinga2-ido-pgsql is ready +#php::extension { ['php-pgsql']: +# require => [ Class['pgsql'] ] +#} + +# runtime users group { 'icinga-cmd': ensure => present } @@ -43,17 +51,6 @@ user { 'apache': 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': 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' ] package { $icinga2_dev_packages: ensure => installed } -#package { 'nagios-plugins-all': -# ensure => installed -#} +# nagios plugins from epel +package { 'nagios-plugins-all': + ensure => installed, + require => Class['epel'] +} -$icinga2_packages = [ 'icinga2', 'icinga2-doc', 'icinga2-ido-mysql', 'icinga2-classicui-config' ] -$icinga1_packages = [ 'icinga-gui' ] +# these package require the icinga-rpm-snapshot repository installed +$icinga2_main_packages = [ 'icinga2', 'icinga2-doc', 'icinga2-ido-mysql', 'icinga-gui' ] -package { $icinga2_packages: +# 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'] } -package { $icinga1_packages: + +package { $icinga2_main_packages: ensure => installed, require => Class['icinga-rpm-snapshot'] } +# enable http 80 exec { 'iptables-allow-http': 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' } +# 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', require => [ Package['apache'], Package['icinga2-doc'] ], notify => Service['apache'] } +# users file { '/etc/motd': source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd', owner => root, @@ -115,6 +121,7 @@ user { 'vagrant': require => Group['icinga-cmd'] } +# icinga2 service & features service { 'icinga2': enable => true, ensure => running, diff --git a/.vagrant-puppet/modules/epel/manifests/init.pp b/.vagrant-puppet/modules/epel/manifests/init.pp index 65e0a2603..9ec1ba692 100644 --- a/.vagrant-puppet/modules/epel/manifests/init.pp +++ b/.vagrant-puppet/modules/epel/manifests/init.pp @@ -16,7 +16,7 @@ class epel { yumrepo { 'epel': mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}", - enabled => '0', + enabled => '1', gpgcheck => '0', descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}" } -- 2.40.0