mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 06:44:33 +02:00
commit
e47f3b2cdf
@ -41,80 +41,80 @@ user { 'icinga':
|
|||||||
|
|
||||||
user { 'apache':
|
user { 'apache':
|
||||||
groups => 'icinga-cmd',
|
groups => 'icinga-cmd',
|
||||||
require => [Package["${apache::apache}"], Group['icinga-cmd']]
|
require => [Class['apache'], Group['icinga-cmd']]
|
||||||
}
|
}
|
||||||
|
|
||||||
cmmi { 'icinga-mysql':
|
cmmi { 'icinga-mysql':
|
||||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.1/icinga-1.9.1.tar.gz/download',
|
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.3/icinga-1.9.3.tar.gz/download',
|
||||||
output => 'icinga-1.9.1.tar.gz',
|
output => 'icinga-1.9.3.tar.gz',
|
||||||
flags => '--prefix=/usr/local/icinga-mysql --with-command-group=icinga-cmd \
|
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-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \
|
||||||
--with-cgiurl=/icinga-mysql/cgi-bin \
|
--with-cgiurl=/icinga-mysql/cgi-bin \
|
||||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||||
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||||
creates => '/usr/local/icinga-mysql',
|
creates => '/usr/local/icinga-mysql',
|
||||||
make => 'make all && make fullinstall install-config',
|
make => 'make all && make fullinstall install-config',
|
||||||
require => [User['icinga'], Cmmi['icinga-plugins']],
|
require => [User['icinga'], Cmmi['icinga-plugins'], Package['apache']],
|
||||||
notify => Service["${apache::apache}"]
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/init.d/icinga-mysql':
|
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']
|
require => Cmmi['icinga-mysql']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/init.d/ido2db-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']
|
require => Cmmi['icinga-mysql']
|
||||||
}
|
}
|
||||||
|
|
||||||
cmmi { 'icinga-pgsql':
|
cmmi { 'icinga-pgsql':
|
||||||
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.1/icinga-1.9.1.tar.gz/download',
|
url => 'http://sourceforge.net/projects/icinga/files/icinga/1.9.3/icinga-1.9.3.tar.gz/download',
|
||||||
output => 'icinga-1.9.1.tar.gz',
|
output => 'icinga-1.9.3.tar.gz',
|
||||||
flags => '--prefix=/usr/local/icinga-pgsql \
|
flags => '--prefix=/usr/local/icinga-pgsql \
|
||||||
--with-command-group=icinga-cmd --enable-idoutils \
|
--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-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \
|
||||||
--with-cgiurl=/icinga-pgsql/cgi-bin \
|
--with-cgiurl=/icinga-pgsql/cgi-bin \
|
||||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||||
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||||
creates => '/usr/local/icinga-pgsql',
|
creates => '/usr/local/icinga-pgsql',
|
||||||
make => 'make all && make fullinstall install-config',
|
make => 'make all && make fullinstall install-config',
|
||||||
require => [User['icinga'], Cmmi['icinga-plugins']],
|
require => [User['icinga'], Cmmi['icinga-plugins'], Package['apache']],
|
||||||
notify => Service["${apache::apache}"]
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/init.d/icinga-pgsql':
|
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']
|
require => Cmmi['icinga-pgsql']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/etc/init.d/ido2db-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']
|
require => Cmmi['icinga-pgsql']
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'populate-icinga-mysql-db':
|
exec { 'populate-icinga-mysql-db':
|
||||||
unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null',
|
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']]
|
require => [Cmmi['icinga-mysql'], Exec['create-mysql-icinga-db']]
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'populate-icinga-pgsql-db':
|
exec { 'populate-icinga-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/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']]
|
require => [Cmmi['icinga-pgsql'], Exec['create-pgsql-icinga-db']]
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'icinga-mysql':
|
service { 'icinga-mysql':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
require => Cmmi['icinga-mysql']
|
require => File['/etc/init.d/icinga-mysql']
|
||||||
}
|
}
|
||||||
|
|
||||||
service { 'ido2db-mysql':
|
service { 'ido2db-mysql':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
require => Cmmi['icinga-mysql']
|
require => File['/etc/init.d/ido2db-mysql']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/usr/local/icinga-mysql/etc/ido2db.cfg':
|
file { '/usr/local/icinga-mysql/etc/ido2db.cfg':
|
||||||
@ -183,7 +183,7 @@ exec { 'iptables-allow-http':
|
|||||||
exec { 'icinga-htpasswd':
|
exec { 'icinga-htpasswd':
|
||||||
creates => '/usr/share/icinga/htpasswd.users',
|
creates => '/usr/share/icinga/htpasswd.users',
|
||||||
command => 'mkdir /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
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':
|
cmmi { 'icinga-plugins':
|
||||||
@ -318,13 +318,13 @@ package { 'boost-devel':
|
|||||||
}
|
}
|
||||||
|
|
||||||
cmmi { 'icinga2':
|
cmmi { 'icinga2':
|
||||||
url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.1/icinga2-0.0.1.tar.gz/download',
|
url => 'http://sourceforge.net/projects/icinga/files/icinga2/0.0.2/icinga2-0.0.2.tar.gz/download',
|
||||||
output => 'icinga2-0.0.1.tar.gz',
|
output => 'icinga2-0.0.2.tar.gz',
|
||||||
flags => '--prefix=/usr/local/icinga2',
|
flags => '--prefix=/usr/local/icinga2',
|
||||||
creates => '/usr/local/icinga2',
|
creates => '/usr/local/icinga2',
|
||||||
make => 'make && make install',
|
make => 'make && make install',
|
||||||
require => Package['boost-devel'],
|
require => Package['boost-devel'],
|
||||||
make_timeout => 600
|
make_timeout => 900
|
||||||
}
|
}
|
||||||
|
|
||||||
file { 'icinga2-web-public':
|
file { 'icinga2-web-public':
|
||||||
@ -335,7 +335,8 @@ file { 'icinga2-web-public':
|
|||||||
|
|
||||||
file { '/etc/httpd/conf.d/icinga2-web.conf':
|
file { '/etc/httpd/conf.d/icinga2-web.conf':
|
||||||
source => 'puppet:////vagrant/.vagrant-puppet/files/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':
|
exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql':
|
||||||
|
17
.vagrant-puppet/manifests/finalize.sh
Normal file
17
.vagrant-puppet/manifests/finalize.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
installJquery () {
|
||||||
|
# The npm module jquery won't install via puppet because of an mysterious error
|
||||||
|
# when node-gyp rebuilding the dependent contextify module
|
||||||
|
if [ ! -d /usr/lib/node_modules/jquery ]; then
|
||||||
|
npm install --silent -g jquery
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mountIcinga2webConfd () {
|
||||||
|
# Remount /vagrant/config with appropriate permissions since the group apache is missing initially
|
||||||
|
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g apache`,dmode=775,fmode=775 v-icinga2web-conf.d /vagrant/config
|
||||||
|
}
|
||||||
|
|
||||||
|
installJquery
|
||||||
|
mountIcinga2webConfd
|
@ -45,7 +45,7 @@ define cmmi(
|
|||||||
|
|
||||||
exec { "download-${name}":
|
exec { "download-${name}":
|
||||||
cwd => $cwd,
|
cwd => $cwd,
|
||||||
command => "wget -q ${url} -O ${output}",
|
command => "wget -q \"${url}\" -O ${output}",
|
||||||
creates => "${cwd}/${output}",
|
creates => "${cwd}/${output}",
|
||||||
require => Class['wget']
|
require => Class['wget']
|
||||||
}
|
}
|
||||||
@ -55,8 +55,9 @@ define cmmi(
|
|||||||
|
|
||||||
exec { "extract-${name}":
|
exec { "extract-${name}":
|
||||||
cwd => $cwd,
|
cwd => $cwd,
|
||||||
command => "mkdir -p ${name} && tar --no-same-owner \
|
command => "mkdir -p ${name}/${tld} && tar --no-same-owner \
|
||||||
--no-same-permissions -xzf ${output} -C ${name}",
|
--no-same-permissions -xzf ${output} -C ${name}/${tld} \
|
||||||
|
--strip-components 1",
|
||||||
creates => $src,
|
creates => $src,
|
||||||
require => Exec["download-${name}"]
|
require => Exec["download-${name}"]
|
||||||
}
|
}
|
||||||
|
@ -17,16 +17,18 @@ define php::extension(
|
|||||||
$ensure=installed
|
$ensure=installed
|
||||||
) {
|
) {
|
||||||
|
|
||||||
|
include apache
|
||||||
include php
|
include php
|
||||||
|
|
||||||
if $::require {
|
if $::require {
|
||||||
$require_ = [Class['php'], $::require]
|
$require_ = [Package['apache'], Class['php'], $::require]
|
||||||
} else {
|
} else {
|
||||||
$require_ = Class['php']
|
$require_ = [Package['apache'], Class['php']]
|
||||||
}
|
}
|
||||||
|
|
||||||
package { $name:
|
package { $name:
|
||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
require => $require_
|
require => $require_,
|
||||||
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,13 +8,25 @@
|
|||||||
#
|
#
|
||||||
# Requires:
|
# Requires:
|
||||||
#
|
#
|
||||||
|
# apache
|
||||||
|
#
|
||||||
# Sample Usage:
|
# Sample Usage:
|
||||||
#
|
#
|
||||||
# include php
|
# include php
|
||||||
#
|
#
|
||||||
class php {
|
class php {
|
||||||
|
|
||||||
|
include apache
|
||||||
|
|
||||||
package { 'php':
|
package { 'php':
|
||||||
ensure => installed
|
ensure => installed,
|
||||||
|
require => Package['apache'],
|
||||||
|
notify => Service['apache']
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/etc/php.d/error_reporting.ini':
|
||||||
|
content => template('php/error_reporting.ini.erb'),
|
||||||
|
require => Package['php'],
|
||||||
|
notify => Service['apache']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
error_reporting = E_ALL | E_STRICT
|
||||||
|
display_errors = On
|
||||||
|
display_startup_errors = On
|
||||||
|
html_errors = On
|
@ -57,14 +57,14 @@ After you should be able to browse [localhost:8080/icinga2-web](http://localhost
|
|||||||
|
|
||||||
**Installed software**:
|
**Installed software**:
|
||||||
|
|
||||||
* Icinga 1.9.1 with IDOUtils using a MySQL database
|
* Icinga with IDOUtils using a MySQL database
|
||||||
* Icinga 1.9.1 with IDOUtils using a PostgreSQL database
|
* Icinga with IDOUtils using a PostgreSQL database
|
||||||
* Icinga 2 version 0.0.1
|
* Icinga 2
|
||||||
|
|
||||||
**Installed files**:
|
**Installed files**:
|
||||||
|
|
||||||
* `/usr/share/icinga/htpasswd.users` account information for logging into the Icinga classic web interface for both icinga instances
|
* `/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
|
#### Icinga with IDOUtils using a MySQL database
|
||||||
|
|
||||||
|
13
Vagrantfile
vendored
13
Vagrantfile
vendored
@ -47,9 +47,8 @@ Vagrant::Config.run do |config|
|
|||||||
# Share an additional folder to the guest VM. The first argument is
|
# 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
|
# 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.
|
# 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-icinga2web-conf.d", "/vagrant/config", "./config"
|
||||||
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-icinga2web-conf.d", "1"]
|
||||||
config.vm.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-test", "1"]
|
|
||||||
|
|
||||||
# Enable provisioning with Puppet stand alone. Puppet manifests
|
# Enable provisioning with Puppet stand alone. Puppet manifests
|
||||||
# are contained in a directory path relative to this Vagrantfile.
|
# 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|
|
config.vm.provision :puppet do |puppet|
|
||||||
puppet.module_path = ".vagrant-puppet/modules"
|
puppet.module_path = ".vagrant-puppet/modules"
|
||||||
puppet.manifests_path = ".vagrant-puppet/manifests"
|
puppet.manifests_path = ".vagrant-puppet/manifests"
|
||||||
# # puppet.options = "-v -d"
|
# puppet.options = "-v -d"
|
||||||
end
|
end
|
||||||
|
|
||||||
# The npm module jquery won't install via puppet because of an mysterious error
|
config.vm.provision :shell, :path => ".vagrant-puppet/manifests/finalize.sh"
|
||||||
# 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
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user