puppet: Use hiera for defining the icinga web group
This commit is contained in:
parent
64d4bb089c
commit
ae4a9fe50c
|
@ -5,3 +5,4 @@ icingaweb2::web_path: icingaweb2
|
||||||
icingaweb2::db_user: icingaweb2
|
icingaweb2::db_user: icingaweb2
|
||||||
icingaweb2::db_pass: icingaweb2
|
icingaweb2::db_pass: icingaweb2
|
||||||
icingaweb2::db_name: icingaweb2
|
icingaweb2::db_name: icingaweb2
|
||||||
|
icingaweb2::group: icingaweb2
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
class icingaweb2::config (
|
class icingaweb2::config (
|
||||||
$config = hiera('icingaweb2::config')
|
$config = hiera('icingaweb2::config'),
|
||||||
|
$web_group = hiera('icingaweb2::group')
|
||||||
) {
|
) {
|
||||||
group { 'icingaweb':
|
group { $web_group:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
}
|
}
|
||||||
|
|
||||||
file { [ "${config}", "${config}/enabledModules", "${config}/modules", "${config}/preferences" ]:
|
file { [ "${config}", "${config}/enabledModules", "${config}/modules", "${config}/preferences" ]:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'icingaweb',
|
group => $web_group,
|
||||||
mode => '2770',
|
mode => '2770',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
define icingaweb2::config::general (
|
define icingaweb2::config::general (
|
||||||
$source,
|
$source,
|
||||||
$config = hiera('icingaweb2::config'),
|
$config = hiera('icingaweb2::config'),
|
||||||
$replace = true
|
$web_group = hiera('icingaweb2::group'),
|
||||||
|
$replace = true
|
||||||
) {
|
) {
|
||||||
include icingaweb2::config
|
include icingaweb2::config
|
||||||
|
|
||||||
file { "${config}/${name}.ini":
|
file { "${config}/${name}.ini":
|
||||||
content => template("${source}/${name}.ini.erb"),
|
content => template("${source}/${name}.ini.erb"),
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'icingaweb',
|
group => $web_group,
|
||||||
mode => 0660,
|
mode => 0660,
|
||||||
replace => $replace,
|
replace => $replace,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
define icingaweb2::config::module (
|
define icingaweb2::config::module (
|
||||||
$module,
|
$module,
|
||||||
$source,
|
$source,
|
||||||
$config = hiera('icingaweb2::config'),
|
$config = hiera('icingaweb2::config'),
|
||||||
$replace = true
|
$web_group = hiera('icingaweb2::group'),
|
||||||
|
$replace = true
|
||||||
) {
|
) {
|
||||||
include icingaweb2::config
|
include icingaweb2::config
|
||||||
|
|
||||||
|
@ -10,7 +11,7 @@ define icingaweb2::config::module (
|
||||||
file { "${config}/modules/${module}":
|
file { "${config}/modules/${module}":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'icingaweb',
|
group => $web_group,
|
||||||
mode => '2770',
|
mode => '2770',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +19,7 @@ define icingaweb2::config::module (
|
||||||
file { "${config}/modules/${module}/${name}.ini":
|
file { "${config}/modules/${module}/${name}.ini":
|
||||||
source => "${source}/modules/${module}/${name}.ini",
|
source => "${source}/modules/${module}/${name}.ini",
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'icingaweb',
|
group => $web_group,
|
||||||
mode => 0660,
|
mode => 0660,
|
||||||
replace => $replace,
|
replace => $replace,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
class icingaweb2_dev (
|
class icingaweb2_dev (
|
||||||
$config = hiera('icingaweb2::config'),
|
$config = hiera('icingaweb2::config'),
|
||||||
$log = hiera('icingaweb2::log'),
|
$log = hiera('icingaweb2::log'),
|
||||||
$web_path = hiera('icingaweb2::web_path'),
|
$web_path = hiera('icingaweb2::web_path'),
|
||||||
$db_user = hiera('icingaweb2::db_user'),
|
$db_user = hiera('icingaweb2::db_user'),
|
||||||
$db_pass = hiera('icingaweb2::db_pass'),
|
$db_pass = hiera('icingaweb2::db_pass'),
|
||||||
$db_name = hiera('icingaweb2::db_name'),
|
$db_name = hiera('icingaweb2::db_name'),
|
||||||
|
$web_group = hiera('icingaweb2::group'),
|
||||||
) {
|
) {
|
||||||
include apache
|
include apache
|
||||||
include php
|
include php
|
||||||
|
@ -28,7 +29,7 @@ class icingaweb2_dev (
|
||||||
Exec { path => '/usr/local/bin:/usr/bin:/bin' }
|
Exec { path => '/usr/local/bin:/usr/bin:/bin' }
|
||||||
|
|
||||||
# TODO(el): Enabling/disabling modules should be a resource
|
# TODO(el): Enabling/disabling modules should be a resource
|
||||||
User <| alias == apache |> { groups +> 'icingaweb' }
|
User <| alias == apache |> { groups +> $web_group }
|
||||||
-> exec { 'enable-monitoring-module':
|
-> exec { 'enable-monitoring-module':
|
||||||
command => 'icingacli module enable monitoring',
|
command => 'icingacli module enable monitoring',
|
||||||
user => 'apache',
|
user => 'apache',
|
||||||
|
@ -50,7 +51,7 @@ class icingaweb2_dev (
|
||||||
file { $log_dir:
|
file { $log_dir:
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
owner => 'root',
|
owner => 'root',
|
||||||
group => 'icingaweb',
|
group => $web_group,
|
||||||
mode => '2775'
|
mode => '2775'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue