Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the icingaweb2 modules to run with older puppet-icingaweb2 than 4… #95

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions manifests/web/director.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
) {
icinga::prepare_web('Director')

$icingaweb2_version = $icinga::web::icingaweb2_version

#
# Database
#
Expand Down Expand Up @@ -110,8 +112,10 @@
onlyif => 'systemctl status icinga-director',
}

class { 'icingaweb2::module::director::service':
ensure => $service_ensure,
enable => $service_enable,
if versioncmp($icingaweb2_version, '4.0.0') < 0 {
class { 'icingaweb2::module::director::service':
ensure => $service_ensure,
enable => $service_enable,
}
}
}
13 changes: 8 additions & 5 deletions manifests/web/reporting.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@

icinga::prepare_web('Reporting')

$_db_charset = $db_type ? {
$icingaweb2_version = $icinga::web::icingaweb2_version
$_db_charset = $db_type ? {
'mysql' => 'utf8mb4',
default => 'UTF8',
}
Expand Down Expand Up @@ -89,10 +90,12 @@
mail => $mail,
}

service { 'icinga-reporting':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::reporting'],
if versioncmp($icingaweb2_version, '4.0.0') < 0 {
service { 'icinga-reporting':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::reporting'],
}
}

if defined(Class['icinga::web::monitoring']) {
Expand Down
13 changes: 8 additions & 5 deletions manifests/web/vspheredb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
) {
icinga::prepare_web('VSphereDB')

$_db_charset = $db_type ? {
$icingaweb2_version = $icinga::web::icingaweb2_version
$_db_charset = $db_type ? {
'mysql' => 'utf8mb4',
default => 'UTF8',
}
Expand Down Expand Up @@ -80,9 +81,11 @@
import_schema => lookup('icingaweb2::module::vspheredb::import_schema', undef, undef, true),
}

service { 'icinga-vspheredb':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::vspheredb'],
if versioncmp($icingaweb2_version, '4.0.0') < 0 {
service { 'icinga-vspheredb':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::vspheredb'],
}
}
}
13 changes: 8 additions & 5 deletions manifests/web/x509.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
fail('Class icinga::web::icingadb or icinga::web::monitoring has to be declared before!')
}

$_db_charset = $db_type ? {
$icingaweb2_version = $icinga::web::icingaweb2_version
$_db_charset = $db_type ? {
'mysql' => 'utf8mb4',
default => 'UTF8',
}
Expand Down Expand Up @@ -82,9 +83,11 @@
import_schema => lookup('icingaweb2::module::x509::import_schema', undef, undef, true),
}

service { 'icinga-x509':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::x509'],
if versioncmp($icingaweb2_version, '4.0.0') < 0 {
service { 'icinga-x509':
ensure => $service_ensure,
enable => $service_enable,
require => Class['icingaweb2::module::x509'],
}
}
}
Loading