From 2587f336d54d3ec5b5a11586b5878cab16013468 Mon Sep 17 00:00:00 2001 From: Lennart Hagemann Date: Thu, 20 Feb 2025 17:54:15 +0100 Subject: [PATCH] Make certificate archive path environment-aware Replaced the hardcoded "production" environment in the certificate's archive module path with Puppet's built-in `$environment` variable. This ensures compatibility with environments that are not named "production" --- manifests/certificates.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/certificates.pp b/manifests/certificates.pp index 4fb8866d..02f37a0b 100644 --- a/manifests/certificates.pp +++ b/manifests/certificates.pp @@ -7,7 +7,8 @@ $manager_certs = [], $manager_master_certs = [], $manager_worker_certs = [], - $dashboard_certs = [] + $dashboard_certs = [], + $archive_file_path = "/etc/puppetlabs/code/environments/${environment}/modules/archive/files" ) { file { 'Configure Wazuh Certificates config.yml': owner => 'root', @@ -38,7 +39,7 @@ ensure => 'directory', source => '/tmp/wazuh-certificates/', recurse => 'remote', - path => '/etc/puppetlabs/code/environments/production/modules/archive/files/', + path => $archive_file_path, owner => 'root', group => 'root', mode => '0755',