From aba72838a7955c816c2bd121115e8bfed0aca1ab Mon Sep 17 00:00:00 2001 From: Lennart Betz Date: Wed, 8 Jan 2020 18:53:07 +0100 Subject: [PATCH] add missing EPEL repo on RedHat to documentation, examples and beaker acceptance tests --- README.md | 11 ++++++++++- examples/example4/profile/manifests/agent.pp | 6 ++++++ examples/example4/profile/manifests/master.pp | 6 ++++++ examples/example4/profile/manifests/slave.pp | 6 ++++++ examples/init_api.pp | 6 ++++++ examples/init_confd.pp | 6 ++++++ examples/init_idomysql.pp | 6 ++++++ examples/init_idomysql_ssl.pp | 6 ++++++ examples/init_idopgsql.pp | 6 ++++++ examples/init_influxdb.pp | 6 ++++++ examples/init_master.pp | 6 ++++++ examples/init_plugins.pp | 6 ++++++ examples/init_repo.pp | 12 ++++++++++++ examples/init_slave.pp | 6 ++++++ examples/init_slave_validate.pp | 6 ++++++ examples/init_syslog.pp | 6 ++++++ examples/objects_from_hiera.pp | 5 +++++ metadata.json | 2 +- spec/acceptance/class_spec.rb | 5 +++++ spec/spec_helper_acceptance.rb | 2 +- 20 files changed, 118 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 65778e795..0807e56ad 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,15 @@ class { '::icinga2': manage_repo => true, } ``` +*Notice*: Since Icinga v2.11.0 on RedHat the EPEL-Repository is required to install the Boost libraries. EPEL is NOT managed by this module so you have to do this on your own in front of icinga2 class, e.g. as `yum_repo` or if you've an internet connection as a simple package resource like: + +``` puppet +package { 'epel-release': } + +class { '::icinga2': + manage_repo => true, +} +``` *Info:* If you are using the [Icinga Web 2](https://github.com/Icinga/puppet-icingaweb2/) Puppet module on the same server, make sure to disable the repository management for one of the modules! @@ -625,7 +634,7 @@ It's not currently possible to use arrays or dictionaries in a string, like #### Reading objects from hiera data -The following example is for puppet 4 and higher. It shows how icinga2 objects can be read from +The following example shows how icinga2 objects can be read from a hiera datastore. See also examples/objects_from_hiera.pp. ``` diff --git a/examples/example4/profile/manifests/agent.pp b/examples/example4/profile/manifests/agent.pp index e0db31bfb..1033f6831 100644 --- a/examples/example4/profile/manifests/agent.pp +++ b/examples/example4/profile/manifests/agent.pp @@ -7,6 +7,12 @@ contain ::profile::icinga2::plugins + case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat + } + class { '::icinga2': manage_repo => true, confd => false, diff --git a/examples/example4/profile/manifests/master.pp b/examples/example4/profile/manifests/master.pp index af9525cdc..a7354d420 100644 --- a/examples/example4/profile/manifests/master.pp +++ b/examples/example4/profile/manifests/master.pp @@ -2,6 +2,12 @@ contain ::profile::icinga2::plugins + case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat + } + class { '::icinga2': manage_repo => true, purge_features => false, diff --git a/examples/example4/profile/manifests/slave.pp b/examples/example4/profile/manifests/slave.pp index bd793e526..89ba4353b 100644 --- a/examples/example4/profile/manifests/slave.pp +++ b/examples/example4/profile/manifests/slave.pp @@ -8,6 +8,12 @@ contain ::profile::icinga2::plugins + case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat + } + class { '::icinga2': manage_repo => true, confd => false, diff --git a/examples/init_api.pp b/examples/init_api.pp index c2250a6fc..d4f7e857e 100644 --- a/examples/init_api.pp +++ b/examples/init_api.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, } diff --git a/examples/init_confd.pp b/examples/init_confd.pp index 20e13f4f2..4375cb6d7 100644 --- a/examples/init_confd.pp +++ b/examples/init_confd.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, confd => '/etc/icinga2/local.d', diff --git a/examples/init_idomysql.pp b/examples/init_idomysql.pp index e7fa498d0..6a2c55399 100644 --- a/examples/init_idomysql.pp +++ b/examples/init_idomysql.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + include ::mysql::server mysql::db { 'icinga2': diff --git a/examples/init_idomysql_ssl.pp b/examples/init_idomysql_ssl.pp index 05f17ebbd..d9cf2ca16 100644 --- a/examples/init_idomysql_ssl.pp +++ b/examples/init_idomysql_ssl.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + file { '/etc/mysql': ensure => directory, } diff --git a/examples/init_idopgsql.pp b/examples/init_idopgsql.pp index 687f5deeb..322c69691 100644 --- a/examples/init_idopgsql.pp +++ b/examples/init_idopgsql.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + include ::postgresql::server postgresql::server::db { 'icinga2': diff --git a/examples/init_influxdb.pp b/examples/init_influxdb.pp index 52334a37d..18b931241 100644 --- a/examples/init_influxdb.pp +++ b/examples/init_influxdb.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, } diff --git a/examples/init_master.pp b/examples/init_master.pp index f522c3ccb..f5990fe8a 100644 --- a/examples/init_master.pp +++ b/examples/init_master.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { '::icinga2': manage_repo => true, constants => { diff --git a/examples/init_plugins.pp b/examples/init_plugins.pp index aa52becf7..d14ca1e55 100644 --- a/examples/init_plugins.pp +++ b/examples/init_plugins.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, plugins => [ 'plugins', 'plugins-contrib', 'windows-plugins', 'nscp' ] diff --git a/examples/init_repo.pp b/examples/init_repo.pp index 295433d2a..345241858 100644 --- a/examples/init_repo.pp +++ b/examples/init_repo.pp @@ -1,3 +1,15 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, } diff --git a/examples/init_slave.pp b/examples/init_slave.pp index 6cc4ec19b..b5af6ed59 100644 --- a/examples/init_slave.pp +++ b/examples/init_slave.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + $master_cert = 'master.localdomain' $master_ip = '192.168.5.16' diff --git a/examples/init_slave_validate.pp b/examples/init_slave_validate.pp index d8caadd92..c764d1658 100644 --- a/examples/init_slave_validate.pp +++ b/examples/init_slave_validate.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + $master_cert = 'master.localdomain' $master_ip = '192.168.5.12' diff --git a/examples/init_syslog.pp b/examples/init_syslog.pp index ad148faa7..aa6e11729 100644 --- a/examples/init_syslog.pp +++ b/examples/init_syslog.pp @@ -1,3 +1,9 @@ +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} + class { 'icinga2': manage_repo => true, } diff --git a/examples/objects_from_hiera.pp b/examples/objects_from_hiera.pp index b87dc8afa..993993143 100644 --- a/examples/objects_from_hiera.pp +++ b/examples/objects_from_hiera.pp @@ -27,6 +27,11 @@ # - generic-service # target: /etc/icinga2/conf.d/services.conf +case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat +} class { 'icinga2': manage_repo => true, diff --git a/metadata.json b/metadata.json index d303d784a..9eb4c1145 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.16.0 < 7.0.0" + "version_requirement": ">= 5.0.0 < 7.0.0" }, { "name": "puppetlabs/concat", diff --git a/spec/acceptance/class_spec.rb b/spec/acceptance/class_spec.rb index 155fd717a..47a7307ac 100644 --- a/spec/acceptance/class_spec.rb +++ b/spec/acceptance/class_spec.rb @@ -5,6 +5,11 @@ describe 'with API, IDO mysql and pgsql' do let(:pp) do <<-MANIFEST + case $::osfamily { + 'redhat': { + package { 'epel-release': } + } # RedHat + } class { 'icinga2': manage_repo => true, constants => { diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 768f3bcb1..75909fe59 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -2,7 +2,7 @@ require 'beaker/puppet_install_helper' # Install Puppet on all hosts -install_puppet_agent_on(hosts, options) +install_puppet_agent_on(hosts, :puppet_collection => 'puppet5') RSpec.configure do |c| module_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))