Clean up the Puppet files.

This commit is contained in:
Gunnar Beutner 2013-10-15 10:12:30 +02:00
parent 152e33ea89
commit d7801f22e9
13 changed files with 56 additions and 56 deletions

View File

@ -10,13 +10,13 @@ include nagios-plugins
# 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
}

View File

@ -20,19 +20,19 @@ class apache {
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'] ]
}
}

View File

@ -31,7 +31,7 @@ define cpan(
}
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
ensure => directory
ensure => directory
}
file { '/root/.cpan/CPAN/MyConfig.pm':

View File

@ -15,10 +15,10 @@
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":

View File

@ -12,7 +12,7 @@ class icinga-classicui {
package { 'icinga-gui':
ensure => installed,
alias => 'icinga-gui'
alias => 'icinga-gui'
}
# runtime users
@ -32,11 +32,11 @@ class icinga-classicui {
}
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']
}
}

View File

@ -16,11 +16,11 @@ class icinga-rpm-snapshot {
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":

View File

@ -8,12 +8,12 @@ class icinga-web {
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\';"',
@ -21,8 +21,8 @@ class 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'] ]
}

View File

@ -4,7 +4,7 @@ class icinga2 {
package { 'icinga2':
ensure => installed,
require => Class['icinga-rpm-snapshot'],
alias => 'icinga2'
alias => 'icinga2'
}
package { 'icinga2-doc':
@ -14,9 +14,10 @@ class icinga2 {
}
service { 'icinga2':
enable => true,
ensure => running,
alias => 'icinga2',
enable => true,
ensure => running,
hasrestart => true,
alias => 'icinga2',
require => Package['icinga2']
}
@ -36,21 +37,21 @@ class icinga2-ido-mysql {
# 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\';"',
@ -59,8 +60,8 @@ class icinga2-ido-mysql {
# 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'] ]
}
@ -70,7 +71,7 @@ class icinga2-ido-mysql {
# include icinga-rpm-snapshot
#
# package { 'icinga2-ido-pgsql':
# ensure => installed,
# ensure => installed,
# require => Class['icinga-rpm-snapshot'],
# alias = 'icinga2-ido-pgsql'
# }
@ -84,7 +85,7 @@ class icinga2-ido-mysql {
# }
#
# 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'] ]
# }

View File

@ -24,14 +24,14 @@ class mysql {
}
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']
}
}

View File

@ -1,7 +1,7 @@
# 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:
#
@ -31,13 +31,13 @@ class pgsql {
}
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']
}
}

View File

@ -27,8 +27,8 @@ define php::extension(
}
package { $name:
ensure => $ensure,
ensure => $ensure,
require => $require_,
notify => Service['apache']
notify => Service['apache']
}
}

View File

@ -19,20 +19,20 @@ class php {
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']
}
}

View File

@ -13,8 +13,7 @@
# include wget
#
class wget {
package { 'wget':
ensure => installed,
ensure => installed,
}
}