Skip to content

Commit

Permalink
fix #368 Add manage_package param to do not manage removed icingaweb2…
Browse files Browse the repository at this point in the history
…-module-monitoring package on Debian and Ubuntu
  • Loading branch information
lbetz committed Sep 28, 2023
1 parent d094ae4 commit e437f85
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ This module can manage all configurations files of Icinga Web 2 and import an in
manage all official [modules](https://www.icinga.com/products/icinga-web-2-modules/) as well as modules developed by the
community.

### What's new in version 3.9.1

The Icinga team removed package icingaweb2-module-monitoring (only on Debian/Ubuntu) for Icinga Web 2 >= 2.12.0. For now
we add an parameter `manage_package` (set to `true` bye default) to do not managed the missing transition package.

### What's new in version 3.0.0

* The current version now uses the `icinga::repos` class from the new module `icinga` for the configuration of
Expand Down
6 changes: 6 additions & 0 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@
# @param pgsql_idoreports_sla_percent
# Location of the get_sla_ok_percent database extension for PostgreSQL.
#
# @param mysql_x509_schema
# Location of the x509 database schema for MySQL/MariaDB.
#
# @param pgsql_x509_schema
# Location of the x509 database schema for PostgreSQL.
#
# @param gettext_package_name
# Package name `gettext` tool belongs to.
#
Expand Down
15 changes: 13 additions & 2 deletions manifests/module/monitoring.pp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
# Custom variables in Icinga 2 may contain sensible information. Set patterns for custom variables
# that should be hidden in the web interface.
#
# @param manage_package
# Set to `false` as Fix for Icinga Web >= 2.12.0 to do not manage the removed package
# `icingaweb2-module-monitoring` (only Debian/Ubuntu).
# See issue #368 (https://github.com/Icinga/puppet-icingaweb2/issues/368).
#
# @param ido_type
# Type of your IDO database. Either `mysql` or `pgsql`.
#
Expand Down Expand Up @@ -91,6 +96,7 @@
Enum['absent', 'present'] $ensure = 'present',
Variant[String, Array[String]] $protected_customvars = ['*pw*', '*pass*', 'community'],
Enum['mysql', 'pgsql'] $ido_type = 'mysql',
Boolean $manage_package = true,
Optional[Stdlib::Host] $ido_host = undef,
Optional[Stdlib::Port] $ido_port = undef,
Optional[String] $ido_db_name = undef,
Expand All @@ -116,8 +122,13 @@

case $facts['os']['family'] {
'Debian': {
$install_method = 'package'
$package_name = 'icingaweb2-module-monitoring'
if $manage_package {
$install_method = 'package'
$package_name = 'icingaweb2-module-monitoring'
} else {
$install_method = 'none'
$package_name = undef
}
}
default: {
$install_method = 'none'
Expand Down
17 changes: 17 additions & 0 deletions spec/classes/monitoring_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,23 @@
}
end

context "#{os} with manage_package 'false'" do
let(:params) do
{ ido_type: 'mysql',
ido_host: 'localhost',
ido_db_name: 'icinga2',
ido_db_username: 'icinga2',
ido_db_password: 'icinga2',
manage_package: false }
end

it {
is_expected.to contain_icingaweb2__module('monitoring')
.with_install_method('none')
.with_module_dir('/usr/share/icingaweb2/modules/monitoring')
}
end

context "#{os} with invalid ido_type" do
let(:params) { { ido_type: 'foobar' } }

Expand Down

0 comments on commit e437f85

Please sign in to comment.