Skip to content

Commit

Permalink
Merge pull request #665 from voxpupuli/stdlib9
Browse files Browse the repository at this point in the history
puppetlabs/stdlib: Require 9.x
  • Loading branch information
bastelfreak committed Jun 26, 2023
2 parents 52d61b5 + f28e924 commit 5b56e4d
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion manifests/alerts.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
owner => 'root',
group => $group,
notify => Class['prometheus::service_reload'],
content => $alerts.to_yaml,
content => $alerts.stdlib::to_yaml,
validate_cmd => "${bin_dir}/promtool check rules %",
require => Class['prometheus::install'],
before => Class['prometheus::config'],
Expand Down
12 changes: 6 additions & 6 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
}

$prometheus::server::collect_scrape_jobs.each |Hash $job_definition| {
if !has_key($job_definition, 'job_name') {
if !stdlib::has_key($job_definition, 'job_name') {
fail('collected scrape job has no job_name!')
}

Expand All @@ -279,11 +279,11 @@
# $scrape_configs in the template
$collected_scrape_jobs = $prometheus::server::collect_scrape_jobs.map |$job_definition| {
$job_name = $job_definition['job_name']
merge($job_definition, {
file_sd_configs => [{
files => ["${prometheus::config_dir}/file_sd_config.d/${job_name}_*.yaml"]
}]
})
$job_definition + {
file_sd_configs => [{
files => ["${prometheus::config_dir}/file_sd_config.d/${job_name}_*.yaml"]
}]
}
}

if versioncmp($prometheus::server::version, '2.0.0') >= 0 {
Expand Down
4 changes: 2 additions & 2 deletions manifests/node_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@
}
}

$web_config_content = merge($tls_server_config, $http_server_config, $basic_auth_config)
$web_config_content = $tls_server_config + $http_server_config + $basic_auth_config

if empty($web_config_content) {
file { $web_config_file:
Expand All @@ -199,7 +199,7 @@
} else {
file { $web_config_file:
ensure => file,
content => $web_config_content.to_yaml,
content => $web_config_content.stdlib::to_yaml,
}

if versioncmp($version, '1.5.0') >= 0 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/process_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
if $hash_watched_processes.empty() {
$config_path_content = template('prometheus/process-exporter.yaml.erb')
} else {
$config_path_content = $hash_watched_processes.to_yaml
$config_path_content = $hash_watched_processes.stdlib::to_yaml
}

file { $config_path:
Expand Down
2 changes: 1 addition & 1 deletion manifests/rabbitmq_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
'RABBIT_EXPORTERS' => join($rabbit_exporters, ','),
}

$real_env_vars = merge($env_vars, $extra_env_vars)
$real_env_vars = stdlib::merge($env_vars, $extra_env_vars)

prometheus::daemon { 'rabbitmq_exporter':
install_method => $install_method,
Expand Down
2 changes: 1 addition & 1 deletion manifests/scrape_job.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
Hash[String[1], String[1]] $labels = {},
Stdlib::Absolutepath $collect_dir = undef,
) {
$config = to_yaml([
$config = stdlib::to_yaml([
{
targets => $targets,
labels => $labels,
Expand Down
2 changes: 1 addition & 1 deletion manifests/statsd_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
mode => $config_mode,
owner => 'root',
group => $group,
content => to_yaml({ mappings => $mappings }),
content => stdlib::to_yaml({ mappings => $mappings }),
notify => $notify_service,
}

Expand Down
6 changes: 3 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 9.0.0"
"version_requirement": ">= 9.0.0 < 10.0.0"
},
{
"name": "puppet/systemd",
"version_requirement": ">= 1.1.1 < 5.0.0"
"version_requirement": ">= 1.1.1 <= 5.1.0"
},
{
"name": "puppet/archive",
"version_requirement": ">= 2.2.0 < 7.0.0"
"version_requirement": ">= 2.2.0 <= 7.0.0"
}
],
"operatingsystem_support": [
Expand Down
2 changes: 1 addition & 1 deletion templates/ipmi_exporter.yaml.epp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%- | Hash $modules | -%>
<%- $config = { 'modules' => $modules } -%>
<%= to_yaml($config) -%>
<%= stdlib::to_yaml($config) -%>
2 changes: 1 addition & 1 deletion templates/sachet.yaml.epp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%- | Array $templates, Array $receivers, Hash $providers | -%>
<%- $config = { 'templates' => $templates, 'receivers' => $receivers, 'providers' => $providers } -%>
<%= to_yaml($config) -%>
<%= stdlib::to_yaml($config) -%>
2 changes: 1 addition & 1 deletion templates/ssh_exporter.yaml.epp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%- | Hash $modules | -%>
<%- $config = { 'modules' => $modules } -%>
<%= to_yaml($config) -%>
<%= stdlib::to_yaml($config) -%>
2 changes: 1 addition & 1 deletion templates/ssl_exporter.yaml.epp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%- | Hash $modules | -%>
<%- $config = { 'modules' => $modules } -%>
<%= to_yaml($config) -%>
<%= stdlib::to_yaml($config) -%>

0 comments on commit 5b56e4d

Please sign in to comment.