Skip to content

Commit

Permalink
fix #730 Add Support for Puppet 8
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Sep 1, 2023
1 parent 8446a16 commit 7871c15
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ And depends on:
* [puppetlabs/concat] >= 2.1.0 < 8.0.0
* [icinga/icinga] >= 1.0.0 < 3.0.0
* needed if `manage_repos` is set to `true`
* [puppetlabs/chocolatey]
* [puppetlabs/chocolatey] >= 5.2.0 < 9.0.0
* needed if agent os is windows and if either `manage_package` or `manage_packages` is set to `true`
### Limitations

Expand Down
2 changes: 1 addition & 1 deletion functions/parse.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function icinga2::parse(
icinga2::icinga2_attributes(
$attrs,
concat($icinga2::globals::reserved, $reserved),
merge($icinga2::_constants, $constants),
stdlib::merge($icinga2::_constants, $constants),
$indent
)
}
2 changes: 1 addition & 1 deletion manifests/feature/elasticsearch.pp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
icinga2::object { 'icinga2::object::ElasticsearchWriter::elasticsearch':
object_name => 'elasticsearch',
object_type => 'ElasticsearchWriter',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/elasticsearch.conf",
notify => $_notify,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/gelf.pp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
icinga2::object { 'icinga2::object::GelfWriter::gelf':
object_name => 'gelf',
object_type => 'GelfWriter',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/gelf.conf",
order => 10,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/icingadb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
icinga2::object { 'icinga2::object::IcingaDB::icingadb':
object_name => 'icingadb',
object_type => 'IcingaDB',
attrs => delete_undef_values(merge($attrs, $attrs_tls)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_tls)),
attrs_list => concat(keys($attrs), keys($attrs_tls)),
target => "${conf_dir}/features-available/icingadb.conf",
order => 10,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/idomysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
icinga2::object { 'icinga2::object::IdoMysqlConnection::ido-mysql':
object_name => 'ido-mysql',
object_type => 'IdoMysqlConnection',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/ido-mysql.conf",
order => 10,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/idopgsql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
icinga2::object { 'icinga2::object::IdoPgsqlConnection::ido-pgsql':
object_name => 'ido-pgsql',
object_type => 'IdoPgsqlConnection',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/ido-pgsql.conf",
order => 10,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
icinga2::object { 'icinga2::object::InfluxdbWriter::influxdb':
object_name => 'influxdb',
object_type => 'InfluxdbWriter',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/influxdb.conf",
notify => $_notify,
Expand Down
2 changes: 1 addition & 1 deletion manifests/feature/influxdb2.pp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
icinga2::object { 'icinga2::object::Influxdb2Writer::influxdb2':
object_name => 'influxdb2',
object_type => 'Influxdb2Writer',
attrs => delete_undef_values(merge($attrs, $attrs_ssl)),
attrs => delete_undef_values(stdlib::merge($attrs, $attrs_ssl)),
attrs_list => concat(keys($attrs), keys($attrs_ssl)),
target => "${conf_dir}/features-available/influxdb2.conf",
notify => $_notify,
Expand Down
11 changes: 0 additions & 11 deletions manifests/globals.pp
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,5 @@
) {
assert_private()

if ( versioncmp($::facts['puppetversion'], '6' ) >= 0 and versioncmp(load_module_metadata('stdlib')['version'], '5.1.0') < 0 ) {
fail('You be affected by this bug: https://github.com/Icinga/puppet-icinga2/issues/505 so you should update your stdlib to version 5.1 or higher')
}

# Logon account on Windows
if $facts['os']['kernel'] == 'windows' {
if $logon_account and versioncmp($::facts['puppetversion'], '6.18.0') < 0 {
fail('Using logon_account requieres a Puppet version 6.18 or higher')
}
}

$constants = lookup('icinga2::globals::constants', Hash, 'deep', {})
}
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
$_reserved = $icinga2::globals::reserved

# merge constants with defaults
$_constants = merge($icinga2::globals::constants, $constants)
$_constants = stdlib::merge($icinga2::globals::constants, $constants)

# validate confd, boolean or string
if $confd =~ Boolean {
Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 5.0.0 < 9.0.0"
"version_requirement": ">= 9.0.0 < 10.0.0"
},
{
"name": "puppetlabs/concat",
"version_requirement": ">= 2.1.0 < 8.0.0"
"version_requirement": ">= 6.4.0 < 10.0.0"
}
],
"operatingsystem_support": [
Expand Down Expand Up @@ -106,7 +106,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 6.0.0 < 8.0.0"
"version_requirement": ">= 7.0.0 < 9.0.0"
}
],
"pdk-version": "2.5.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/object.conf.epp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Array $ignore = [],
| -%>

<% $_attrs = merge($attrs, { 'assign where' => $assign, 'ignore where' => $ignore, }) -%>
<% $_attrs = stdlib::merge($attrs, { 'assign where' => $assign, 'ignore where' => $ignore, }) -%>
<% if $apply =~ String { %>apply <%= $object_type -%>
<% if $prefix { -%>
<% if $prefix =~ String { %> "<%= $prefix %>"<% } else { -%>
Expand Down

0 comments on commit 7871c15

Please sign in to comment.