From 224198f624bcb93bfabc69d3860f7194b4563c02 Mon Sep 17 00:00:00 2001 From: Arne Teuke Date: Sat, 18 Oct 2025 14:07:20 +0200 Subject: [PATCH] fix template - https://gitlab.confdroid.com/internal/confdroid_management/-/issues/260 --- manifests/main/dirs.pp | 2 +- manifests/main/files.pp | 2 +- manifests/main/service.pp | 4 ++-- templates/prometheus.yml.erb | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/manifests/main/dirs.pp b/manifests/main/dirs.pp index 3c24a54..691e771 100644 --- a/manifests/main/dirs.pp +++ b/manifests/main/dirs.pp @@ -6,7 +6,7 @@ class prometheus_cd::main::dirs ( ) inherits prometheus_cd::params { require prometheus_cd::main::install - if $ps_prom_host == fqdn { + ($ps_prom_host == $fqdn) and ($manage_prometheus == true) { file { $ps_main_dir: ensure => directory, owner => 'root', diff --git a/manifests/main/files.pp b/manifests/main/files.pp index cdb7623..a7529c9 100644 --- a/manifests/main/files.pp +++ b/manifests/main/files.pp @@ -6,7 +6,7 @@ class prometheus_cd::main::files ( ) inherits prometheus_cd::params { require prometheus_cd::main::dirs - if $ps_prom_host == fqdn { + if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) { file { $ps_main_file: ensure => file, owner => 'root', diff --git a/manifests/main/service.pp b/manifests/main/service.pp index 0acde91..21e3db3 100644 --- a/manifests/main/service.pp +++ b/manifests/main/service.pp @@ -5,9 +5,9 @@ ############################################################################## class prometheus_cd::main::service ( ) inherits prometheus_cd::params { - require prometheus_cd::main::files - require prometheus_cd::firewall::iptables if ($ps_prom_host == $fqdn) and ($manage_prometheus == true) { + require prometheus_cd::main::files + require prometheus_cd::firewall::iptables service { $ps_prom_service: ensure => running, hasstatus => true, diff --git a/templates/prometheus.yml.erb b/templates/prometheus.yml.erb index e75b941..9c8521a 100644 --- a/templates/prometheus.yml.erb +++ b/templates/prometheus.yml.erb @@ -1,3 +1,7 @@ +############################################################################### +##### File created by Puppet - manual changes will be overwritten ##### +############################################################################### + global: scrape_interval: 60s scrape_timeout: 10s