diff --git a/README.md b/README.md index e580260b7..cfcfd960f 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. diff --git a/manifests/init.pp b/manifests/init.pp index e9e6f3487..d004acf1e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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. # @@ -148,6 +152,7 @@ $constants = {}, $plugins = $icinga2::params::plugins, $confd = true, + $repositoryd = true, ) inherits ::icinga2::params { validate_re($ensure, [ '^running$', '^stopped$' ], @@ -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) { diff --git a/manifests/install.pp b/manifests/install.pp index d22d960cf..b42227a49 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -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, } } @@ -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], + } + } diff --git a/templates/icinga2.conf.erb b/templates/icinga2.conf.erb index d206d9385..c00d48a6c 100644 --- a/templates/icinga2.conf.erb +++ b/templates/icinga2.conf.erb @@ -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 -%> /**