From aacfce5550e70bdcc75518c43c4d097f44859af4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 1 Aug 2024 15:57:27 +0200 Subject: [PATCH] extlib__puppet_config: Add environment settings ```json { "extlib__puppet_config": { "master": { "localcacert": "/etc/puppetlabs/puppet/ssl/certs/ca.pem", "ssldir": "/etc/puppetlabs/puppet/ssl" }, "main": { "hostpubkey": "/etc/puppetlabs/puppet/ssl/public_keys/puppet.local.pem", "hostprivkey": "/etc/puppetlabs/puppet/ssl/private_keys/puppet.local.pem", "hostcert": "/etc/puppetlabs/puppet/ssl/certs/puppet.local.pem", "localcacert": "/etc/puppetlabs/puppet/ssl/certs/ca.pem", "ssldir": "/etc/puppetlabs/puppet/ssl", "vardir": "/opt/puppetlabs/puppet/cache", "server": "puppet.local", "environment": "production" }, "agent": { "environment": "production" } } } ``` --- lib/facter/extlib__puppet_config.rb | 4 +++- spec/unit/facter/extlib__puppet_config_spec.rb | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/facter/extlib__puppet_config.rb b/lib/facter/extlib__puppet_config.rb index b5e0573..b1c5ce0 100644 --- a/lib/facter/extlib__puppet_config.rb +++ b/lib/facter/extlib__puppet_config.rb @@ -17,7 +17,9 @@ ssldir vardir server - ] + environment + ], + agent: %i[environment], } desired_settings.each_pair do |section, settings| diff --git a/spec/unit/facter/extlib__puppet_config_spec.rb b/spec/unit/facter/extlib__puppet_config_spec.rb index a5e055d..bc9a7f4 100644 --- a/spec/unit/facter/extlib__puppet_config_spec.rb +++ b/spec/unit/facter/extlib__puppet_config_spec.rb @@ -14,11 +14,15 @@ 'localcacert' => '/dev/null/ssl/certs/ca.pem', 'server' => 'puppet', 'ssldir' => '/dev/null/ssl', - 'vardir' => '/dev/null' + 'vardir' => '/dev/null', + 'environment' => 'production' }, 'master' => { 'localcacert' => '/dev/null/ssl/certs/ca.pem', 'ssldir' => '/dev/null/ssl' + }, + 'agent' => { + 'environment' => 'production' } } end