Profile `icingaweb2_dev': outsource Icinga Web 2 config file provision into (new) `define's

icingaweb2::config
icingaweb2::config::monitoring

refs #6842
This commit is contained in:
Alexander Klimov 2014-09-09 13:40:16 +02:00
parent 77719be042
commit 6aa2dcdd72
3 changed files with 28 additions and 67 deletions

View File

@ -0,0 +1,9 @@
define icingaweb2::config ($source, $replace = true) {
$path = "/etc/icingaweb/${name}.ini"
file { $path:
source => "${source}${path}",
owner => 'apache',
group => 'apache',
replace => $replace,
}
}

View File

@ -0,0 +1,6 @@
define icingaweb2::config::monitoring ($source, $replace = true) {
icingaweb2::config { "modules/monitoring/${name}":
source => $source,
replace => $replace,
}
}

View File

@ -30,84 +30,30 @@ class icingaweb2_dev {
notify => Service['apache'],
}
file { '/etc/icingaweb':
ensure => 'directory',
owner => 'apache',
group => 'apache'
}
file { '/etc/icingaweb/authentication.ini':
source => 'puppet:////vagrant/config/authentication.ini',
owner => 'apache',
group => 'apache',
require => File['/etc/icingaweb'],
}
file { '/etc/icingaweb/config.ini':
ensure => file,
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/menu.ini':
source => 'puppet:////vagrant/config/menu.ini',
owner => 'apache',
group => 'apache',
# replace => false,
}
file { '/etc/icingaweb/resources.ini':
source => 'puppet:////vagrant/config/resources.ini',
owner => 'apache',
group => 'apache',
replace => false
}
file { ['/etc/icingaweb/enabledModules', '/etc/icingaweb/modules', '/etc/icingaweb/modules/monitoring', '/etc/icingaweb/modules/doc']:
file { [
'/etc/icingaweb',
'/etc/icingaweb/enabledModules',
'/etc/icingaweb/modules',
'/etc/icingaweb/modules/monitoring',
'/etc/icingaweb/modules/doc',
'/etc/icingaweb/dashboard'
]:
ensure => 'directory',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/modules/monitoring/backends.ini':
source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini',
owner => 'apache',
group => 'apache',
icingaweb2::config { [ 'dashboard/dashboard', 'modules/doc/menu', 'authentication', 'menu' ]: }
icingaweb2::config { 'resources':
replace => false,
}
file { '/etc/icingaweb/modules/monitoring/config.ini':
source => 'puppet:////vagrant/config/modules/monitoring/config.ini',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/modules/monitoring/instances.ini':
source => 'puppet:////vagrant/config/modules/monitoring/instances.ini',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/modules/monitoring/menu.ini':
source => 'puppet:////vagrant/config/modules/monitoring/menu.ini',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/dashboard':
ensure => 'directory',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/dashboard/dashboard.ini':
source => 'puppet:////vagrant/config/dashboard/dashboard.ini',
owner => 'apache',
group => 'apache',
}
file { '/etc/icingaweb/modules/doc/menu.ini':
source => 'puppet:////vagrant/config/modules/doc/menu.ini',
owner => 'apache',
group => 'apache',
}
icingaweb2::config::monitoring { [ 'backends', 'config', 'instances', 'menu' ]: }
}