From de0a84737eea6e828bc449b6d93d5a6f50047cce Mon Sep 17 00:00:00 2001 From: 12ww1160 Date: Thu, 4 Dec 2025 12:01:57 +0100 Subject: [PATCH] OP#188 create proper boolean --- manifests/main/dirs.pp | 4 ++-- manifests/params.pp | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/manifests/main/dirs.pp b/manifests/main/dirs.pp index e0893e8..65a538f 100644 --- a/manifests/main/dirs.pp +++ b/manifests/main/dirs.pp @@ -29,7 +29,7 @@ class prometheus_cd::main::dirs ( seltype => systemd_unit_file_t, seluser => unconfined_u, } - if $ps_write_external == true { + if $ps_enable_pruning == true { file { $ps_pruning_dir: ensure => directory, owner => 'prometheus', @@ -41,7 +41,7 @@ class prometheus_cd::main::dirs ( seluser => unconfined_u, } } - if $ps_write_external == false { + if $ps_enable_pruning == false { file { $ps_pruning_dir: ensure => absent, } diff --git a/manifests/params.pp b/manifests/params.pp index 0545c43..16d5dc7 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -28,6 +28,7 @@ # @param [String] ps_auth_ext_user user for writing to extern instance # @param [String] ps_auth_ext_pass password for writing to extern instance # @param [String] ps_external_url the full url for the remote write point +# @param [Boolean] ps_enable_pruning whether to allow pruning local blocks # @param [String] ps_pruning_dir the directory for the pruning script ############################################################################## class prometheus_cd::params ( @@ -75,7 +76,8 @@ class prometheus_cd::params ( String $ps_external_url = 'http://changeme.local/write', # pruning script - String $ps_pruning_dir = '/opt/prometheus-prune' + Boolean $ps_enable_pruning = false, + String $ps_pruning_dir = '/opt/prometheus-prune', ) { # defaults