Skip to content

Commit

Permalink
Ownergroupwindows (voxpupuli#437)
Browse files Browse the repository at this point in the history
address localized windows server problem.
I use the same param already used for linux.
If you think it leads to complexity or misunderstanding I can change.
  • Loading branch information
MelanieGault authored Apr 10, 2018
1 parent 98c0d46 commit 831bec9
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
4 changes: 2 additions & 2 deletions manifests/config/fragment.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
case $::osfamily {
'windows': {
Concat {
owner => 'Administrators',
group => 'NETWORK SERVICE',
owner => $::icinga2::params::user,
group => $::icinga2::params::group,
mode => '0770',
}
$_content = regsubst($content, '\n', "\r\n", 'EMG')
Expand Down
21 changes: 21 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
# `repository.d` is removed since Icinga 2 2.8.0, set to true (default) will handle the directory.
# This Parameter will change to false by default in v2.0.0 and will be removed in the future.
#
# [*user*]
# User is set by default for each OS in params.pp, but, with some localized
# version of OS you can specify another user
#
# [*group*]
# Group is set by default for each OS in params.pp, but, with some localized
# version of OS you may have to specify another group.
#
# All default parameters are set in the icinga2::params class. To get more technical information have a look into the
# params.pp manifest.
#
Expand Down Expand Up @@ -139,6 +147,17 @@
# ...
# confd => 'local.d',
# }
#
# To manage a French windows agent
#
# class { '::icinga2':
# manage_repo => false,
# manage_package => false,
# confd => false,
# user => 'Administrateurs',
# group => 'Service Réseau',
# features => [ 'checker','mainlog' ],
# }
#
#
class icinga2(
Expand All @@ -153,6 +172,8 @@
$plugins = $icinga2::params::plugins,
$confd = true,
$repositoryd = true,
$user = $icinga2::params::user,
$group = $icinga2::params::group,
) inherits ::icinga2::params {

validate_re($ensure, [ '^running$', '^stopped$' ],
Expand Down
4 changes: 2 additions & 2 deletions manifests/object.pp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
case $::osfamily {
'windows': {
Concat {
owner => 'Administrators',
group => 'NETWORK SERVICE',
owner => $::icinga2::params::user,
group => $::icinga2::params::group,
mode => '0770',
}
} # windows
Expand Down
4 changes: 2 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
} # Linux

'windows': {
$user = undef
$group = undef
$user = 'Administrators'
$group = 'NETWORK SERVICE'
$icinga2_bin = 'icinga2.exe'
$bin_dir = 'C:/Program Files/icinga2/sbin'
$conf_dir = 'C:/ProgramData/icinga2/etc/icinga2'
Expand Down

0 comments on commit 831bec9

Please sign in to comment.