Revert "Put always a ',' after a parameter because explicit is better than implicit"
This reverts commit 26205a76b3
.
This commit is contained in:
parent
0677105d45
commit
67efe52141
|
@ -30,44 +30,44 @@ package { [
|
|||
'libpng', 'libpng-devel', 'net-snmp', 'net-snmp-devel', 'net-snmp-utils',
|
||||
'libdbi', 'libdbi-devel', 'libdbi-drivers',
|
||||
'libdbi-dbd-mysql', 'libdbi-dbd-pgsql' ]:
|
||||
ensure => installed,
|
||||
ensure => installed
|
||||
}
|
||||
|
||||
php::extension { ['php-mysql', 'php-pgsql', 'php-ldap']:
|
||||
require => [ Class['mysql'], Class['pgsql'], Class['openldap'] ],
|
||||
require => [ Class['mysql'], Class['pgsql'], Class['openldap'] ]
|
||||
}
|
||||
|
||||
php::extension { 'php-gd': }
|
||||
|
||||
group { 'icinga-cmd':
|
||||
ensure => present,
|
||||
ensure => present
|
||||
}
|
||||
|
||||
group { 'icingacmd':
|
||||
ensure => present,
|
||||
require => Package['icinga2'],
|
||||
require => Package['icinga2']
|
||||
}
|
||||
|
||||
user { 'icinga':
|
||||
ensure => present,
|
||||
groups => 'icinga-cmd',
|
||||
managehome => false,
|
||||
managehome => false
|
||||
}
|
||||
|
||||
user { 'apache':
|
||||
groups => ['icinga-cmd', 'vagrant', 'icingacmd'],
|
||||
require => [ Class['apache'], Group['icinga-cmd'], Group['icingacmd'] ],
|
||||
require => [ Class['apache'], Group['icinga-cmd'], Group['icingacmd'] ]
|
||||
}
|
||||
|
||||
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',
|
||||
command => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables'
|
||||
}
|
||||
|
||||
exec { 'icinga-htpasswd':
|
||||
creates => '/usr/share/icinga/htpasswd.users',
|
||||
command => 'mkdir -p /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
||||
require => Class['apache'],
|
||||
require => Class['apache']
|
||||
}
|
||||
|
||||
cmmi { 'icinga-plugins':
|
||||
|
@ -78,7 +78,7 @@ cmmi { 'icinga-plugins':
|
|||
--with-cgiurl=/icinga-mysql/cgi-bin',
|
||||
creates => '/usr/lib64/nagios/plugins/libexec',
|
||||
make => 'make && make install',
|
||||
require => User['icinga'],
|
||||
require => User['icinga']
|
||||
}
|
||||
|
||||
cmmi { 'mk-livestatus':
|
||||
|
@ -87,7 +87,7 @@ cmmi { 'mk-livestatus':
|
|||
flags => '--prefix=/usr/local/icinga-mysql --exec-prefix=/usr/local/icinga-mysql',
|
||||
creates => '/usr/local/icinga-mysql/lib/mk-livestatus',
|
||||
make => 'make && make install',
|
||||
require => Cmmi['icinga-mysql'],
|
||||
require => Cmmi['icinga-mysql']
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-mysql/etc/modules/mk-livestatus.cfg':
|
||||
|
@ -95,25 +95,25 @@ file { '/usr/local/icinga-mysql/etc/modules/mk-livestatus.cfg':
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['mk-livestatus'],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ]
|
||||
}
|
||||
|
||||
file { 'openldap/db.ldif':
|
||||
path => '/usr/share/openldap-servers/db.ldif',
|
||||
source => 'puppet:///modules/openldap/db.ldif',
|
||||
require => Class['openldap'],
|
||||
require => Class['openldap']
|
||||
}
|
||||
|
||||
file { 'openldap/dit.ldif':
|
||||
path => '/usr/share/openldap-servers/dit.ldif',
|
||||
source => 'puppet:///modules/openldap/dit.ldif',
|
||||
require => Class['openldap'],
|
||||
require => Class['openldap']
|
||||
}
|
||||
|
||||
file { 'openldap/users.ldif':
|
||||
path => '/usr/share/openldap-servers/users.ldif',
|
||||
source => 'puppet:///modules/openldap/users.ldif',
|
||||
require => Class['openldap'],
|
||||
require => Class['openldap']
|
||||
}
|
||||
|
||||
exec { 'populate-openldap':
|
||||
|
@ -122,23 +122,23 @@ exec { 'populate-openldap':
|
|||
sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/dit.ldif || true && \
|
||||
sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/users.ldif || true',
|
||||
require => [ Service['slapd'], File['openldap/db.ldif'],
|
||||
File['openldap/dit.ldif'], File['openldap/users.ldif'] ],
|
||||
File['openldap/dit.ldif'], File['openldap/users.ldif'] ]
|
||||
}
|
||||
|
||||
class { 'phantomjs':
|
||||
url => "https://phantomjs.googlecode.com/files/phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2",
|
||||
output => "phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2",
|
||||
creates => '/usr/local/phantomjs',
|
||||
creates => '/usr/local/phantomjs'
|
||||
}
|
||||
|
||||
class { 'casperjs':
|
||||
url => "https://github.com/n1k0/casperjs/tarball/${casperjsVersion}",
|
||||
output => "casperjs-${casperjsVersion}.tar.gz",
|
||||
creates => '/usr/local/casperjs',
|
||||
creates => '/usr/local/casperjs'
|
||||
}
|
||||
|
||||
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'
|
||||
}
|
||||
|
||||
include epel
|
||||
|
@ -146,23 +146,23 @@ include epel
|
|||
exec { 'install PHPUnit':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-phpunit-PHPUnit',
|
||||
unless => 'rpm -qa | grep php-phpunit-PHPUnit',
|
||||
require => Class['epel'],
|
||||
require => Class['epel']
|
||||
}
|
||||
|
||||
exec { 'install PHP CodeSniffer':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-pear-PHP-CodeSniffer',
|
||||
unless => 'rpm -qa | grep php-pear-PHP-CodeSniffer',
|
||||
require => Class['epel'],
|
||||
require => Class['epel']
|
||||
}
|
||||
|
||||
exec { 'install php-ZendFramework':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework',
|
||||
unless => 'rpm -qa | grep php-ZendFramework',
|
||||
require => Class['epel'],
|
||||
require => Class['epel']
|
||||
}
|
||||
|
||||
package { ['cmake', 'boost-devel', 'bison', 'flex']:
|
||||
ensure => installed,
|
||||
ensure => installed
|
||||
}
|
||||
|
||||
# icinga 2
|
||||
|
@ -171,7 +171,7 @@ yumrepo { 'icinga2-repo':
|
|||
enabled => '1',
|
||||
gpgcheck => '1',
|
||||
gpgkey => 'http://packages.icinga.org/icinga.key',
|
||||
descr => "Icinga Repository - ${::architecture}",
|
||||
descr => "Icinga Repository - ${::architecture}"
|
||||
}
|
||||
|
||||
exec { 'install nagios-plugins-all':
|
||||
|
@ -184,7 +184,7 @@ exec { 'install nagios-plugins-all':
|
|||
package { 'icinga-gui':
|
||||
ensure => latest,
|
||||
require => Yumrepo['icinga2-repo'],
|
||||
alias => 'icinga-gui',
|
||||
alias => 'icinga-gui'
|
||||
}
|
||||
|
||||
# icinga 2 ido mysql
|
||||
|
@ -196,18 +196,18 @@ package { 'icinga-gui':
|
|||
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Mysql',
|
||||
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Mysql',
|
||||
require => Exec['install php-ZendFramework'],
|
||||
require => Exec['install php-ZendFramework']
|
||||
}
|
||||
|
||||
file { '/etc/motd':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd',
|
||||
owner => root,
|
||||
group => root,
|
||||
group => root
|
||||
}
|
||||
|
||||
user { 'vagrant':
|
||||
groups => 'icinga-cmd',
|
||||
require => Group['icinga-cmd'],
|
||||
require => Group['icinga-cmd']
|
||||
}
|
||||
|
||||
mysql::database::create { 'icinga_unittest':
|
||||
|
@ -224,7 +224,7 @@ pgsql::database::create { 'icinga_unittest':
|
|||
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Pgsql',
|
||||
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Pgsql',
|
||||
require => Exec['install php-ZendFramework'],
|
||||
require => Exec['install php-ZendFramework']
|
||||
}
|
||||
|
||||
|
||||
|
@ -235,7 +235,7 @@ exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql':
|
|||
#
|
||||
cpan { 'Monitoring::Generator::TestConfig':
|
||||
creates => '/usr/local/share/perl5/Monitoring/Generator/TestConfig.pm',
|
||||
timeout => 600,
|
||||
timeout => 600
|
||||
}
|
||||
|
||||
exec { 'create_monitoring_test_config':
|
||||
|
@ -243,7 +243,7 @@ exec { 'create_monitoring_test_config':
|
|||
sudo /usr/local/bin/create_monitoring_test_config.pl -l icinga \
|
||||
/usr/local/share/misc/monitoring_test_config',
|
||||
creates => '/usr/local/share/misc/monitoring_test_config',
|
||||
require => Cpan['Monitoring::Generator::TestConfig'],
|
||||
require => Cpan['Monitoring::Generator::TestConfig']
|
||||
}
|
||||
|
||||
define populate_monitoring_test_config {
|
||||
|
@ -251,13 +251,13 @@ define populate_monitoring_test_config {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
||||
notify => Service['icinga-mysql'],
|
||||
notify => Service['icinga-mysql']
|
||||
}
|
||||
file { "/usr/local/icinga-pgsql/etc/conf.d/test_config/${name}.cfg":
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
||||
notify => Service['icinga-pgsql'],
|
||||
notify => Service['icinga-pgsql']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -265,14 +265,14 @@ file { '/usr/local/icinga-mysql/etc/conf.d/test_config/':
|
|||
ensure => directory,
|
||||
owner => icinga,
|
||||
group => icinga,
|
||||
require => Cmmi['icinga-mysql'],
|
||||
require => Cmmi['icinga-mysql']
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-pgsql/etc/conf.d/test_config/':
|
||||
ensure => directory,
|
||||
owner => icinga,
|
||||
group => icinga,
|
||||
require => Cmmi['icinga-pgsql'],
|
||||
require => Cmmi['icinga-pgsql']
|
||||
}
|
||||
|
||||
populate_monitoring_test_config { ['commands', 'contacts', 'dependencies',
|
||||
|
@ -287,7 +287,7 @@ define populate_monitoring_test_config_plugins {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}",
|
||||
notify => [ Service['icinga-mysql'], Service['icinga-pgsql'] ],
|
||||
notify => [ Service['icinga-mysql'], Service['icinga-pgsql'] ]
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -310,14 +310,14 @@ file { [ '/usr/local/icinga/', '/usr/local/icinga/var/', '/usr/local/icinga/var/
|
|||
ensure => directory,
|
||||
owner => icinga,
|
||||
group => icinga,
|
||||
require => User['icinga'],
|
||||
require => User['icinga']
|
||||
}
|
||||
|
||||
file { '/usr/local/bin/icinga_command_proxy':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy',
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 755,
|
||||
mode => 755
|
||||
}
|
||||
|
||||
file { '/etc/init.d/icinga_command_proxy':
|
||||
|
@ -325,12 +325,12 @@ file { '/etc/init.d/icinga_command_proxy':
|
|||
owner => root,
|
||||
group => root,
|
||||
mode => 755,
|
||||
require => File['/usr/local/bin/icinga_command_proxy'],
|
||||
require => File['/usr/local/bin/icinga_command_proxy']
|
||||
}
|
||||
|
||||
service { 'icinga_command_proxy':
|
||||
ensure => running,
|
||||
require => [ File['/etc/init.d/icinga_command_proxy'], Service['icinga-mysql'], Service['icinga-pgsql'] ],
|
||||
require => [ File['/etc/init.d/icinga_command_proxy'], Service['icinga-mysql'], Service['icinga-pgsql'] ]
|
||||
}
|
||||
|
||||
mysql::database::create { 'icinga_web':
|
||||
|
@ -346,13 +346,13 @@ cmmi { 'icinga-web':
|
|||
creates => '/usr/local/icinga-web',
|
||||
make => 'make install && make install-apache-config',
|
||||
require => Service['icinga_command_proxy'],
|
||||
notify => Service['apache'],
|
||||
notify => Service['apache']
|
||||
}
|
||||
|
||||
exec { 'populate-icinga_web-mysql-db':
|
||||
unless => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null',
|
||||
command => 'mysql -uicinga_web -picinga_web icinga_web < /usr/local/src/icinga-web/icinga-web-1.10.0-beta/etc/schema/mysql.sql',
|
||||
require => [ Exec['create-mysql-icinga_web-db'], Cmmi['icinga-web'] ],
|
||||
require => [ Exec['create-mysql-icinga_web-db'], Cmmi['icinga-web'] ]
|
||||
}
|
||||
|
||||
file { '/var/www/html/icingaweb':
|
||||
|
@ -360,7 +360,7 @@ file { '/var/www/html/icingaweb':
|
|||
}
|
||||
|
||||
# pear::package { 'deepend/Mockery':
|
||||
# channel => 'pear.survivethedeepend.com',
|
||||
# channel => 'pear.survivethedeepend.com'
|
||||
# }
|
||||
|
||||
# icingacli
|
||||
|
@ -369,13 +369,13 @@ file { '/usr/local/bin/icingacli':
|
|||
target => '/vagrant/bin/icingacli',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
require => [ File['/etc/icingaweb'], File['/etc/bash_completion.d/icingacli'] ],
|
||||
require => [ File['/etc/icingaweb'], File['/etc/bash_completion.d/icingacli'] ]
|
||||
}
|
||||
|
||||
exec { 'install bash-completion':
|
||||
command => 'yum -d 0 -e 0 -y --enablerepo=epel install bash-completion',
|
||||
unless => 'rpm -qa | grep bash-completion',
|
||||
require => Class['epel'],
|
||||
require => Class['epel']
|
||||
}
|
||||
|
||||
file { '/etc/bash_completion.d/icingacli':
|
||||
|
@ -383,6 +383,6 @@ file { '/etc/bash_completion.d/icingacli':
|
|||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => 755,
|
||||
require => Exec['install bash-completion'],
|
||||
require => Exec['install bash-completion']
|
||||
}
|
||||
|
||||
|
|
|
@ -16,17 +16,17 @@ class apache {
|
|||
|
||||
$apache = $::operatingsystem ? {
|
||||
/(Debian|Ubuntu)/ => 'apache2',
|
||||
/(RedHat|CentOS|Fedora)/ => 'httpd',
|
||||
/(RedHat|CentOS|Fedora)/ => 'httpd'
|
||||
}
|
||||
|
||||
package { $apache:
|
||||
ensure => installed,
|
||||
alias => 'apache',
|
||||
alias => 'apache'
|
||||
}
|
||||
|
||||
service { $apache:
|
||||
ensure => running,
|
||||
alias => 'apache',
|
||||
require => Package['apache'],
|
||||
require => Package['apache']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# class {'casperjs':
|
||||
# url => 'https://github.com/n1k0/casperjs/tarball/1.0.2',
|
||||
# output => 'casperjs-1.0.2.tar.gz',
|
||||
# creates => '/usr/local/casperjs',
|
||||
# creates => '/usr/local/casperjs'
|
||||
# }
|
||||
#
|
||||
class casperjs(
|
||||
|
@ -37,7 +37,7 @@ class casperjs(
|
|||
command => "wget -q ${url} -O ${output}",
|
||||
creates => "${cwd}/${output}",
|
||||
timeout => 120,
|
||||
require => Class['wget'],
|
||||
require => Class['wget']
|
||||
}
|
||||
|
||||
$tld = inline_template('<%= File.basename(output, ".tar.bz2") %>')
|
||||
|
@ -49,18 +49,18 @@ class casperjs(
|
|||
--no-same-permissions -xzf ${output} -C ${src} \
|
||||
--strip-components 1",
|
||||
creates => $src,
|
||||
require => Exec['download-casperjs'],
|
||||
require => Exec['download-casperjs']
|
||||
}
|
||||
|
||||
file { 'install-casperjs':
|
||||
path => $creates,
|
||||
source => $src,
|
||||
recurse => true,
|
||||
require => Exec['extract-casperjs'],
|
||||
require => Exec['extract-casperjs']
|
||||
}
|
||||
|
||||
file { 'link-casperjs-bin':
|
||||
ensure => "${creates}/bin/casperjs",
|
||||
path => '/usr/local/bin/casperjs',
|
||||
path => '/usr/local/bin/casperjs'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
# output => 'example-software.tar.gz',
|
||||
# flags => '--prefix=/opt/example-software',
|
||||
# creates => '/opt/example-software',
|
||||
# make => 'make && make install',
|
||||
# make_timeout => 600,
|
||||
# make => 'make && make install'
|
||||
# make_timeout => 600
|
||||
# }
|
||||
#
|
||||
define cmmi(
|
||||
|
@ -48,7 +48,7 @@ define cmmi(
|
|||
cwd => $cwd,
|
||||
command => "wget -q \"${url}\" -O ${output}",
|
||||
creates => "${cwd}/${output}",
|
||||
require => Class['wget'],
|
||||
require => Class['wget']
|
||||
}
|
||||
|
||||
$tld = inline_template('<%= File.basename(output, ".tar.gz") %>')
|
||||
|
@ -60,14 +60,14 @@ define cmmi(
|
|||
--no-same-permissions -xzf ${output} -C ${name}/${tld} \
|
||||
--strip-components 1",
|
||||
creates => $src,
|
||||
require => Exec["download-${name}"],
|
||||
require => Exec["download-${name}"]
|
||||
}
|
||||
|
||||
exec { "configure-${name}":
|
||||
cwd => $src,
|
||||
command => "${configure_command} ${flags}",
|
||||
creates => "${src}/Makefile",
|
||||
require => Exec["extract-${name}"],
|
||||
require => Exec["extract-${name}"]
|
||||
}
|
||||
|
||||
exec { "make-${name}":
|
||||
|
@ -75,6 +75,6 @@ define cmmi(
|
|||
command => $make,
|
||||
creates => $creates,
|
||||
require => Exec["configure-${name}"],
|
||||
timeout => $make_timeout,
|
||||
timeout => $make_timeout
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,6 @@ define configure(
|
|||
) {
|
||||
exec { "configure-${name}":
|
||||
cwd => $path,
|
||||
command => "sh ./configure ${flags}",
|
||||
command => "sh ./configure ${flags}"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -16,7 +16,7 @@
|
|||
#
|
||||
# cpan { 'perl-module':
|
||||
# creates => '/usr/local/share/perl5/perl-module',
|
||||
# timeout => 600,
|
||||
# timeout => 600
|
||||
# }
|
||||
#
|
||||
define cpan(
|
||||
|
@ -27,11 +27,11 @@ define cpan(
|
|||
Exec { path => '/usr/bin' }
|
||||
|
||||
package { 'perl-CPAN':
|
||||
ensure => installed,
|
||||
ensure => installed
|
||||
}
|
||||
|
||||
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
|
||||
ensure => directory,
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
file { '/root/.cpan/CPAN/MyConfig.pm':
|
||||
|
@ -44,6 +44,6 @@ define cpan(
|
|||
command => "sudo perl -MCPAN -e 'install ${name}'",
|
||||
creates => $creates,
|
||||
require => File['/root/.cpan/CPAN/MyConfig.pm'],
|
||||
timeout => $timeout,
|
||||
timeout => $timeout
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class epel {
|
|||
mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}",
|
||||
enabled => '0',
|
||||
gpgcheck => '0',
|
||||
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}",
|
||||
descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ define mysql::database::create ($username, $password, $privileges) {
|
|||
command => "mysql -uroot -e \"CREATE DATABASE ${name}; \
|
||||
GRANT ${privileges} ON ${name}.* TO ${username}@localhost \
|
||||
IDENTIFIED BY '${password}';\"",
|
||||
require => Service['mysqld'],
|
||||
require => Service['mysqld']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,6 @@ define mysql::database::populate ($username, $password, $privileges, $schemafile
|
|||
exec { "populate-${name}-mysql-db":
|
||||
unless => "mysql -u${username} -p${password} ${name} -e \"SELECT * FROM icinga_dbversion;\" &> /dev/null",
|
||||
command => "mysql -uroot ${name} < ${schemafile}",
|
||||
require => [ $requirement, Exec["create-mysql-${name}-db"] ],
|
||||
require => [ $requirement, Exec["create-mysql-${name}-db"] ]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,12 +25,12 @@ class mysql {
|
|||
|
||||
service { 'mysqld':
|
||||
ensure => running,
|
||||
require => Package['mysql-server'],
|
||||
require => Package['mysql-server']
|
||||
}
|
||||
|
||||
file { '/etc/my.cnf':
|
||||
content => template('mysql/my.cnf.erb'),
|
||||
require => Package['mysql-server'],
|
||||
notify => Service['mysqld'],
|
||||
notify => Service['mysqld']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,12 +14,12 @@
|
|||
#
|
||||
class openldap {
|
||||
|
||||
package { ['openldap-servers', 'openldap-clients']:
|
||||
ensure => installed,
|
||||
package { ['openldap-servers', 'openldap-clients']:
|
||||
ensure => installed
|
||||
}
|
||||
|
||||
service { 'slapd':
|
||||
ensure => running,
|
||||
require => Package['openldap-servers'],
|
||||
require => Package['openldap-servers']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,22 +22,22 @@ class pear {
|
|||
|
||||
package { 'php-pear':
|
||||
ensure => installed,
|
||||
require => Class['php'],
|
||||
require => Class['php']
|
||||
}
|
||||
|
||||
exec { 'pear upgrade':
|
||||
command => 'pear upgrade',
|
||||
require => Package['php-pear'],
|
||||
require => Package['php-pear']
|
||||
}
|
||||
|
||||
exec { 'pear update-channels':
|
||||
command => 'pear update-channels',
|
||||
require => Package['php-pear'],
|
||||
require => Package['php-pear']
|
||||
}
|
||||
|
||||
exec { 'pear auto discover channels':
|
||||
command => 'pear config-set auto_discover 1',
|
||||
unless => 'pear config-get auto_discover | grep 1',
|
||||
require => Package['php-pear'],
|
||||
require => Package['php-pear']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,18 +33,18 @@ define pear::package(
|
|||
command => "sudo pear channel-discover ${channel}",
|
||||
unless => "pear channel-info ${channel}",
|
||||
require => $require_,
|
||||
before => Exec["pear install ${name}"],
|
||||
before => Exec["pear install ${name}"]
|
||||
}
|
||||
}
|
||||
|
||||
exec { "pear install ${name}":
|
||||
command => "pear install --alldeps ${name}",
|
||||
unless => "pear list ${name}",
|
||||
require => $require_,
|
||||
require => $require_
|
||||
}
|
||||
|
||||
exec { "pear upgrade ${name}":
|
||||
command => "pear upgrade ${name}",
|
||||
require => Exec["pear install ${name}"],
|
||||
require => Exec["pear install ${name}"]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ define pgsql::database::create ($username, $password) {
|
|||
command => "sudo -u postgres psql -c \"CREATE ROLE ${username} WITH LOGIN PASSWORD '${password}';\" && \
|
||||
sudo -u postgres createdb -O ${username} -E UTF8 -T template0 ${name} && \
|
||||
sudo -u postgres createlang plpgsql ${name}",
|
||||
require => Service['postgresql'],
|
||||
require => Service['postgresql']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,6 @@ define pgsql::database::populate ($username, $password, $schemafile, $requiremen
|
|||
exec { "populate-${name}-pgsql-db":
|
||||
unless => "psql -U ${username} -d ${name} -c \"SELECT * FROM icinga_dbversion;\" &> /dev/null",
|
||||
command => "sudo -u postgres psql -U ${username} -d ${name} < ${schemafile}",
|
||||
require => [ $requirement, Exec["create-pgsql-${name}-db"] ],
|
||||
require => [ $requirement, Exec["create-pgsql-${name}-db"] ]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,17 +27,17 @@ class pgsql {
|
|||
exec { 'initdb':
|
||||
creates => '/var/lib/pgsql/data/pg_xlog',
|
||||
command => 'service postgresql initdb',
|
||||
require => Package['postgresql-server'],
|
||||
require => Package['postgresql-server']
|
||||
}
|
||||
|
||||
service { 'postgresql':
|
||||
ensure => running,
|
||||
require => [Package['postgresql-server'], Exec['initdb']],
|
||||
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']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# class {'phantomjs':
|
||||
# url => 'https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2',
|
||||
# output => 'phantomjs-1.9.1-linux-x86_64.tar.bz2',
|
||||
# creates => '/usr/local/phantomjs',
|
||||
# creates => '/usr/local/phantomjs'
|
||||
# }
|
||||
#
|
||||
class phantomjs(
|
||||
|
@ -37,7 +37,7 @@ class phantomjs(
|
|||
command => "wget -q ${url} -O ${output}",
|
||||
creates => "${cwd}/${output}",
|
||||
timeout => 120,
|
||||
require => Class['wget'],
|
||||
require => Class['wget']
|
||||
}
|
||||
|
||||
$src = "${cwd}/phantomjs"
|
||||
|
@ -48,18 +48,18 @@ class phantomjs(
|
|||
--no-same-permissions -xjf ${output} -C ${src} \
|
||||
--strip-components 1",
|
||||
creates => $src,
|
||||
require => Exec['download-phantomjs'],
|
||||
require => Exec['download-phantomjs']
|
||||
}
|
||||
|
||||
file { 'install-phantomjs':
|
||||
path => $creates,
|
||||
source => $src,
|
||||
recurse => true,
|
||||
require => Exec['extract-phantomjs'],
|
||||
require => Exec['extract-phantomjs']
|
||||
}
|
||||
|
||||
file { 'link-phantomjs-bin':
|
||||
ensure => "${creates}/bin/phantomjs",
|
||||
path => '/usr/local/bin/phantomjs',
|
||||
path => '/usr/local/bin/phantomjs'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,6 @@ define php::extension(
|
|||
package { $name:
|
||||
ensure => $ensure,
|
||||
require => $require_,
|
||||
notify => Service['apache'],
|
||||
notify => Service['apache']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,18 +21,18 @@ class php {
|
|||
package { 'php':
|
||||
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']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class profile::icinga-mysql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-mysql'],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ]
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-mysql/etc/idomod.cfg':
|
||||
|
@ -47,7 +47,7 @@ class profile::icinga-mysql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-mysql'],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ]
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-mysql/etc/modules/idoutils.cfg':
|
||||
|
@ -55,7 +55,7 @@ class profile::icinga-mysql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-mysql'],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ],
|
||||
notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ]
|
||||
}
|
||||
|
||||
mysql::database::populate { 'icinga':
|
||||
|
|
|
@ -40,7 +40,7 @@ class profile::icinga-pgsql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-pgsql'],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ]
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-pgsql/etc/idomod.cfg':
|
||||
|
@ -48,7 +48,7 @@ class profile::icinga-pgsql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-pgsql'],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ]
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-pgsql/etc/modules/idoutils.cfg':
|
||||
|
@ -56,7 +56,7 @@ class profile::icinga-pgsql ($icingaVersion) {
|
|||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => Cmmi['icinga-pgsql'],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ],
|
||||
notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ]
|
||||
}
|
||||
|
||||
pgsql::database::populate { 'icinga':
|
||||
|
|
|
@ -13,7 +13,7 @@ class profile::icinga2 ($icinga2Version) {
|
|||
unless => "readlink /etc/icinga2/features-enabled/${feature}.conf",
|
||||
command => "icinga2-enable-feature ${feature}",
|
||||
require => [ Package['icinga2'] ],
|
||||
notify => Service['icinga2'],
|
||||
notify => Service['icinga2']
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,25 +32,25 @@ class profile::icinga2 ($icinga2Version) {
|
|||
File['/etc/icinga2/features-enabled/ido-mysql.conf'],
|
||||
File['/etc/icinga2/conf.d/test-config.conf'],
|
||||
File['/etc/icinga2/conf.d/commands.conf']
|
||||
],
|
||||
]
|
||||
}
|
||||
|
||||
package { 'icinga2':
|
||||
ensure => latest,
|
||||
require => Yumrepo['icinga2-repo'],
|
||||
alias => 'icinga2',
|
||||
alias => 'icinga2'
|
||||
}
|
||||
|
||||
package { 'icinga2-bin':
|
||||
ensure => latest,
|
||||
require => [ Yumrepo['icinga2-repo'], Package['icinga2'] ],
|
||||
alias => 'icinga2-bin',
|
||||
alias => 'icinga2-bin'
|
||||
}
|
||||
|
||||
package { 'icinga2-doc':
|
||||
ensure => latest,
|
||||
require => Yumrepo['icinga2-repo'],
|
||||
alias => 'icinga2-doc',
|
||||
alias => 'icinga2-doc'
|
||||
}
|
||||
|
||||
package { 'icinga2-classicui-config':
|
||||
|
@ -63,7 +63,7 @@ class profile::icinga2 ($icinga2Version) {
|
|||
package { 'icinga2-ido-mysql':
|
||||
ensure => latest,
|
||||
require => Yumrepo['icinga2-repo'],
|
||||
alias => 'icinga2-ido-mysql',
|
||||
alias => 'icinga2-ido-mysql'
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,7 +87,7 @@ class profile::icinga2 ($icinga2Version) {
|
|||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf',
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
require => [ Package['icinga2'], Exec['create_monitoring_test_config'] ],
|
||||
require => [ Package['icinga2'], Exec['create_monitoring_test_config'] ]
|
||||
}
|
||||
|
||||
file { '/etc/icinga2/conf.d/commands.conf':
|
||||
|
|
|
@ -13,25 +13,25 @@ class profile::icingaweb2 {
|
|||
exec { 'populate-icingaweb-mysql-db-accounts':
|
||||
unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM account;" &> /dev/null',
|
||||
command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/accounts.mysql.sql',
|
||||
require => [ Exec['create-mysql-icingaweb-db'] ],
|
||||
require => [ Exec['create-mysql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
exec { 'populate-icingweba-pgsql-db-accounts':
|
||||
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM account;" &> /dev/null',
|
||||
command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/accounts.pgsql.sql',
|
||||
require => [ Exec['create-pgsql-icingaweb-db'] ],
|
||||
require => [ Exec['create-pgsql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
exec { 'populate-icingaweb-mysql-db-preferences':
|
||||
unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM preference;" &> /dev/null',
|
||||
command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/preferences.mysql.sql',
|
||||
require => [ Exec['create-mysql-icingaweb-db'] ],
|
||||
require => [ Exec['create-mysql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
exec { 'populate-icingweba-pgsql-db-preferences':
|
||||
unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM preference;" &> /dev/null',
|
||||
command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/preferences.pgsql.sql',
|
||||
require => [ Exec['create-pgsql-icingaweb-db'] ],
|
||||
require => [ Exec['create-pgsql-icingaweb-db'] ]
|
||||
}
|
||||
|
||||
file { '/etc/httpd/conf.d/icingaweb.conf':
|
||||
|
@ -43,7 +43,7 @@ class profile::icingaweb2 {
|
|||
file { '/etc/icingaweb':
|
||||
ensure => 'directory',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
group => 'apache'
|
||||
}
|
||||
|
||||
file { '/etc/icingaweb/authentication.ini':
|
||||
|
@ -70,7 +70,7 @@ class profile::icingaweb2 {
|
|||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/resources.ini',
|
||||
owner => 'apache',
|
||||
group => 'apache',
|
||||
replace => false,
|
||||
replace => false
|
||||
}
|
||||
|
||||
file { ['/etc/icingaweb/enabledModules', '/etc/icingaweb/modules', '/etc/icingaweb/modules/monitoring']:
|
||||
|
|
Loading…
Reference in New Issue