Skip to content

Commit

Permalink
add repositoryd to always be managed incl. absent
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Nov 18, 2017
1 parent 9d0bf5e commit 2070fa5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ configuration of Icinga 2 on multiple operating systems.

### Notices

For Icinga 2 v2.8.0 and higher version v1.3.4 and above is needed. See issue #403.
For Icinga 2 v2.8.0 and higher version v1.3.4 and above is needed and the parameter repositoryd
can set to false. See issue #403.

## Module Description

Expand Down
22 changes: 14 additions & 8 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
$package = $::icinga2::params::package
$manage_package = $::icinga2::manage_package
$pki_dir = $::icinga2::params::pki_dir
$repositoryd = $::icinga2::repositoryd
$conf_dir = $::icinga2::params::conf_dir
$user = $::icinga2::params::user
$group = $::icinga2::params::group
$repositoryd = $::icinga2::repositoryd

if $manage_package {
if $::osfamily == 'windows' { Package { provider => chocolatey, } }
Expand All @@ -40,13 +40,19 @@
}

# deprecated, removed in Icinga 2 v2.8.0
if $repositoryd {
file { "${conf_dir}/repository.d":
ensure => directoy,
owner => $user,
group => $group,
require => File[$conf_dir],
}
$_ensure = $repositoryd ? {
true => 'directory',
default => 'absent',
}

file { "${conf_dir}/repository.d":
ensure => $_ensure,
owner => $user,
group => $group,
recurse => true,
purge => true,
force => true,
require => File[$pki_dir, $conf_dir],
}

}
Expand Down

0 comments on commit 2070fa5

Please sign in to comment.