Skip to content

Commit

Permalink
Merge pull request #404 from Icinga/bug/repository.d-missing-after-in…
Browse files Browse the repository at this point in the history
…stall-403

Bug/repository.d missing after install 403
  • Loading branch information
lbetz authored Nov 18, 2017
2 parents a85d00d + 2070fa5 commit 4a67dfb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@
Icinga 2 is a widely used open source monitoring software. This Puppet module helps with installing and managing
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 and the parameter repositoryd
can set to false. See issue #403.

## Module Description

This module installs and configures Icinga 2 on your Linux or Windows hosts.
Expand Down Expand Up @@ -879,6 +884,10 @@ set this parameter to `false`. By default this parameter is `true`. It's also po
own directory. This directory and must be managed outside of this module as file resource
with tag icinga2::config::file.

##### `repositoryd`
`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.

#### Class: `icinga2::feature::checker`
Enables or disables the `checker` feature.

Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@
# own directory. This directory must be managed outside of this module as file resource
# with tag icinga2::config::file.
#
# [*repositoryd*]
# `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.
#
# 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 @@ -148,6 +152,7 @@
$constants = {},
$plugins = $icinga2::params::plugins,
$confd = true,
$repositoryd = true,
) inherits ::icinga2::params {

validate_re($ensure, [ '^running$', '^stopped$' ],
Expand All @@ -160,6 +165,7 @@
validate_bool($purge_features)
validate_hash($constants)
validate_array($plugins)
validate_bool($repositoryd)

# validate confd, boolean or string
if is_bool($confd) {
Expand Down
18 changes: 18 additions & 0 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
$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 @@ -37,5 +38,22 @@
owner => $user,
group => $group,
}

# deprecated, removed in Icinga 2 v2.8.0
$_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],
}

}

2 changes: 2 additions & 0 deletions templates/icinga2.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ include <<%= p %>>
* the features-enabled directory.
*/
include "features-enabled/*.conf"
<% if @repositoryd -%>

/**
* The repository.d directory contains all configuration objects
* managed by the 'icinga2 repository' CLI commands.
*/
include_recursive "repository.d"
<% end -%>

<% if @confd -%>
/**
Expand Down

0 comments on commit 4a67dfb

Please sign in to comment.