parent
2609c8765b
commit
69400ce671
|
@ -41,80 +41,80 @@ user { 'icinga':
|
|||
|
||||
user { 'apache':
|
||||
groups => 'icinga-cmd',
|
||||
require => [Package["${apache::apache}"], Group['icinga-cmd']]
|
||||
require => [Class['apache'], Group['icinga-cmd']]
|
||||
}
|
||||
|
||||
cmmi { 'icinga-mysql':
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.1/icinga-1.9.1.tar.gz/download',
|
||||
output => 'icinga-1.9.1.tar.gz',
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.3/icinga-1.9.3.tar.gz/download',
|
||||
output => 'icinga-1.9.3.tar.gz',
|
||||
flags => '--prefix=/usr/local/icinga-mysql --with-command-group=icinga-cmd \
|
||||
--enable-idoutils --with-init-dir=/tmp/icinga-mysql/etc/init.d \
|
||||
--enable-idoutils --with-init-dir=/usr/local/icinga-mysql/etc/init.d \
|
||||
--with-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \
|
||||
--with-cgiurl=/icinga-mysql/cgi-bin \
|
||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||
creates => '/usr/local/icinga-mysql',
|
||||
make => 'make all && make fullinstall install-config',
|
||||
require => [User['icinga'], Cmmi['icinga-plugins']],
|
||||
notify => Service["${apache::apache}"]
|
||||
require => [User['icinga'], Cmmi['icinga-plugins'], Package['apache']],
|
||||
notify => Service['apache']
|
||||
}
|
||||
|
||||
file { '/etc/init.d/icinga-mysql':
|
||||
source => '/tmp/icinga-mysql/etc/init.d/icinga',
|
||||
source => '/usr/local/icinga-mysql/etc/init.d/icinga',
|
||||
require => Cmmi['icinga-mysql']
|
||||
}
|
||||
|
||||
file { '/etc/init.d/ido2db-mysql':
|
||||
source => '/tmp/icinga-mysql/etc/init.d/ido2db',
|
||||
source => '/usr/local/icinga-mysql/etc/init.d/ido2db',
|
||||
require => Cmmi['icinga-mysql']
|
||||
}
|
||||
|
||||
cmmi { 'icinga-pgsql':
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.1/icinga-1.9.1.tar.gz/download',
|
||||
output => 'icinga-1.9.1.tar.gz',
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.3/icinga-1.9.3.tar.gz/download',
|
||||
output => 'icinga-1.9.3.tar.gz',
|
||||
flags => '--prefix=/usr/local/icinga-pgsql \
|
||||
--with-command-group=icinga-cmd --enable-idoutils \
|
||||
--with-init-dir=/tmp/icinga-pgsql/etc/init.d \
|
||||
--with-init-dir=/usr/local/icinga-pgsql/etc/init.d \
|
||||
--with-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \
|
||||
--with-cgiurl=/icinga-pgsql/cgi-bin \
|
||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||
creates => '/usr/local/icinga-pgsql',
|
||||
make => 'make all && make fullinstall install-config',
|
||||
require => [User['icinga'], Cmmi['icinga-plugins']],
|
||||
notify => Service["${apache::apache}"]
|
||||
require => [User['icinga'], Cmmi['icinga-plugins'], Package['apache']],
|
||||
notify => Service['apache']
|
||||
}
|
||||
|
||||
file { '/etc/init.d/icinga-pgsql':
|
||||
source => '/tmp/icinga-pgsql/etc/init.d/icinga',
|
||||
source => '/usr/local/icinga-pgsql/etc/init.d/icinga',
|
||||
require => Cmmi['icinga-pgsql']
|
||||
}
|
||||
|
||||
file { '/etc/init.d/ido2db-pgsql':
|
||||
source => '/tmp/icinga-pgsql/etc/init.d/ido2db',
|
||||
source => '/usr/local/icinga-pgsql/etc/init.d/ido2db',
|
||||
require => Cmmi['icinga-pgsql']
|
||||
}
|
||||
|
||||
exec { 'populate-icinga-mysql-db':
|
||||
unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
|
||||
command => 'mysql -uicinga -picinga icinga < /usr/local/src/icinga-mysql/icinga-1.9.1/module/idoutils/db/mysql/mysql.sql',
|
||||
command => 'mysql -uicinga -picinga icinga < /usr/local/src/icinga-mysql/icinga-1.9.3/module/idoutils/db/mysql/mysql.sql',
|
||||
require => [Cmmi['icinga-mysql'], Exec['create-mysql-icinga-db']]
|
||||
}
|
||||
|
||||
exec { 'populate-icinga-pgsql-db':
|
||||
unless => 'psql -U icinga -d icinga -c "SELECT * FROM icinga_dbversion;" &> /dev/null',
|
||||
command => 'sudo -u postgres psql -U icinga -d icinga < /usr/local/src/icinga-pgsql/icinga-1.9.1/module/idoutils/db/pgsql/pgsql.sql',
|
||||
command => 'sudo -u postgres psql -U icinga -d icinga < /usr/local/src/icinga-pgsql/icinga-1.9.3/module/idoutils/db/pgsql/pgsql.sql',
|
||||
require => [Cmmi['icinga-pgsql'], Exec['create-pgsql-icinga-db']]
|
||||
}
|
||||
|
||||
service { 'icinga-mysql':
|
||||
ensure => running,
|
||||
require => Cmmi['icinga-mysql']
|
||||
require => File['/etc/init.d/icinga-mysql']
|
||||
}
|
||||
|
||||
service { 'ido2db-mysql':
|
||||
ensure => running,
|
||||
require => Cmmi['icinga-mysql']
|
||||
require => File['/etc/init.d/ido2db-mysql']
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-mysql/etc/ido2db.cfg':
|
||||
|
@ -183,7 +183,7 @@ exec { 'iptables-allow-http':
|
|||
exec { 'icinga-htpasswd':
|
||||
creates => '/usr/share/icinga/htpasswd.users',
|
||||
command => 'mkdir /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
||||
require => Package["${apache::apache}"]
|
||||
require => Class['apache']
|
||||
}
|
||||
|
||||
cmmi { 'icinga-plugins':
|
||||
|
@ -318,13 +318,13 @@ package { 'boost-devel':
|
|||
}
|
||||
|
||||
cmmi { 'icinga2':
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.1/icinga2-0.0.1.tar.gz/download',
|
||||
output => 'icinga2-0.0.1.tar.gz',
|
||||
url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.2/icinga2-0.0.2.tar.gz/download',
|
||||
output => 'icinga2-0.0.2.tar.gz',
|
||||
flags => '--prefix=/usr/local/icinga2',
|
||||
creates => '/usr/local/icinga2',
|
||||
make => 'make && make install',
|
||||
require => Package['boost-devel'],
|
||||
make_timeout => 600
|
||||
make_timeout => 900
|
||||
}
|
||||
|
||||
file { 'icinga2-web-public':
|
||||
|
@ -335,7 +335,8 @@ file { 'icinga2-web-public':
|
|||
|
||||
file { '/etc/httpd/conf.d/icinga2-web.conf':
|
||||
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icinga2-web.conf',
|
||||
notify => Service["${apache::apache}"]
|
||||
require => Package['apache'],
|
||||
notify => Service['apache']
|
||||
}
|
||||
|
||||
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql':
|
||||
|
|
|
@ -45,7 +45,7 @@ define cmmi(
|
|||
|
||||
exec { "download-${name}":
|
||||
cwd => $cwd,
|
||||
command => "wget -q ${url} -O ${output}",
|
||||
command => "wget -q \"${url}\" -O ${output}",
|
||||
creates => "${cwd}/${output}",
|
||||
require => Class['wget']
|
||||
}
|
||||
|
@ -55,8 +55,9 @@ define cmmi(
|
|||
|
||||
exec { "extract-${name}":
|
||||
cwd => $cwd,
|
||||
command => "mkdir -p ${name} && tar --no-same-owner \
|
||||
--no-same-permissions -xzf ${output} -C ${name}",
|
||||
command => "mkdir -p ${name}/${tld} && tar --no-same-owner \
|
||||
--no-same-permissions -xzf ${output} -C ${name}/${tld} \
|
||||
--strip-components 1",
|
||||
creates => $src,
|
||||
require => Exec["download-${name}"]
|
||||
}
|
||||
|
|
|
@ -17,16 +17,18 @@ define php::extension(
|
|||
$ensure=installed
|
||||
) {
|
||||
|
||||
include apache
|
||||
include php
|
||||
|
||||
if $::require {
|
||||
$require_ = [Class['php'], $::require]
|
||||
$require_ = [Package['apache'], Class['php'], $::require]
|
||||
} else {
|
||||
$require_ = Class['php']
|
||||
$require_ = [Package['apache'], Class['php']]
|
||||
}
|
||||
|
||||
package { $name:
|
||||
ensure => $ensure,
|
||||
require => $require_
|
||||
require => $require_,
|
||||
notify => Service['apache']
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,14 +57,14 @@ After you should be able to browse [localhost:8080/icinga2-web](http://localhost
|
|||
|
||||
**Installed software**:
|
||||
|
||||
* Icinga 1.9.1 with IDOUtils using a MySQL database
|
||||
* Icinga 1.9.1 with IDOUtils using a PostgreSQL database
|
||||
* Icinga 2 version 0.0.1
|
||||
* Icinga with IDOUtils using a MySQL database
|
||||
* Icinga with IDOUtils using a PostgreSQL database
|
||||
* Icinga 2
|
||||
|
||||
**Installed files**:
|
||||
|
||||
* `/usr/share/icinga/htpasswd.users` account information for logging into the Icinga classic web interface for both icinga instances
|
||||
* `/usr/lib64/nagios/plugins` Nagios Plugins 1.4.16 for both icinga instances
|
||||
* `/usr/lib64/nagios/plugins` Nagios Plugins for both icinga instances
|
||||
|
||||
#### Icinga with IDOUtils using a MySQL database
|
||||
|
||||
|
|
|
@ -47,9 +47,8 @@ Vagrant::Config.run do |config|
|
|||
# Share an additional folder to the guest VM. The first argument is
|
||||
# an identifier, the second is the path on the guest to mount the
|
||||
# folder, and the third is the path on the host to the actual folder.
|
||||
# # config.vm.share_folder "v-icinga2-web-pub", "/var/www/html/icinga2-web", "./pub"
|
||||
config.vm.share_folder "v-test", "/vagrant/config", "./config", :owner => 'vagrant', :group => 'apache', :extra => 'dmode=775,fmode=775'
|
||||
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-test", "1"]
|
||||
config.vm.share_folder "v-icinga2web-conf.d", "/vagrant/config", "./config"
|
||||
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-icinga2web-conf.d", "1"]
|
||||
|
||||
# Enable provisioning with Puppet stand alone. Puppet manifests
|
||||
# are contained in a directory path relative to this Vagrantfile.
|
||||
|
@ -58,12 +57,8 @@ Vagrant::Config.run do |config|
|
|||
config.vm.provision :puppet do |puppet|
|
||||
puppet.module_path = ".vagrant-puppet/modules"
|
||||
puppet.manifests_path = ".vagrant-puppet/manifests"
|
||||
# # puppet.options = "-v -d"
|
||||
# puppet.options = "-v -d"
|
||||
end
|
||||
|
||||
# The npm module jquery won't install via puppet because of an mysterious error
|
||||
# when node-gyp rebuilding the dependent contextify module
|
||||
config.vm.provision :shell do |shell|
|
||||
shell.inline = "[ -d /usr/lib/node_modules/jquery ] || npm install --silent -g jquery"
|
||||
end
|
||||
config.vm.provision :shell, :path => ".vagrant-puppet/manifests/finalize.sh"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue