Skip to content

Commit

Permalink
fix voxpupuli#403 repository.d missing
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz authored and n00by committed Apr 26, 2018
1 parent c715143 commit 264a520
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
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. See issue #403.

## Module Description

This module installs and configures Icinga 2 on your Linux or Windows hosts.
Expand Down Expand Up @@ -879,6 +883,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
12 changes: 12 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
$conf_dir = $::icinga2::params::conf_dir
$plugins = $::icinga2::plugins
$confd = $::icinga2::_confd
$repositoryd = $::icinga2::repositoryd
$purge_features = $::icinga2::purge_features
$user = $::icinga2::params::user
$group = $::icinga2::params::group

if $::kernel != 'windows' {
$template_constants = icinga2_attributes($constants)
Expand All @@ -29,6 +32,15 @@
$template_mainconfig = regsubst(template('icinga2/icinga2.conf.erb'), '\n', "\r\n", 'EMG')
}

# deprecated, removed in Icinga 2 v2.8.0
if $repositoryd {
file { "${conf_dir}/repository.d":
ensure => directoy,
owner => $user,
group => $group,
}
}

file { "${conf_dir}/constants.conf":
ensure => file,
content => $template_constants,
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
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 264a520

Please sign in to comment.