From 1a9544ec55a13d7883d7215fbc3d6b43b5770f8a Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Fri, 30 Aug 2024 11:18:25 -0700 Subject: [PATCH] Hardcode hostname and domain Rather than introducing new environment variables, just hard code the default value in the config reference like we do for others. --- lib/puppet/reference/configuration.rb | 4 ++++ lib/puppet/settings.rb | 4 ++-- rakelib/generate_references.rake | 3 --- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/puppet/reference/configuration.rb b/lib/puppet/reference/configuration.rb index bd91adf441a..44058f82ce3 100644 --- a/lib/puppet/reference/configuration.rb +++ b/lib/puppet/reference/configuration.rb @@ -41,6 +41,10 @@ val = '$confdir/hiera.yaml. However, for backwards compatibility, if a file exists at $codedir/hiera.yaml, Puppet uses that instead.' when 'certname' val = "the Host's fully qualified domain name, as determined by Facter" + when 'hostname' + val = "(the system's fully qualified hostname)" + when 'domain' + val = "(the system's own domain)" when 'srv_domain' val = 'example.com' when 'http_user_agent' diff --git a/lib/puppet/settings.rb b/lib/puppet/settings.rb index 59ee87fa0e5..8571285edad 100644 --- a/lib/puppet/settings.rb +++ b/lib/puppet/settings.rb @@ -81,11 +81,11 @@ def self.default_certname end def self.hostname_fact - ENV['PUPPET_REFERENCES_HOSTNAME'] || Puppet.runtime[:facter].value('networking.hostname') + Puppet.runtime[:facter].value('networking.hostname') end def self.domain_fact - ENV['PUPPET_REFERENCES_DOMAIN'] || Puppet.runtime[:facter].value('networking.domain') + Puppet.runtime[:facter].value('networking.domain') end def self.default_config_file_name diff --git a/rakelib/generate_references.rake b/rakelib/generate_references.rake index 3d2b99246c4..9ab9e8e8866 100644 --- a/rakelib/generate_references.rake +++ b/rakelib/generate_references.rake @@ -41,9 +41,6 @@ end namespace :references do desc "Generate configuration reference" task :configuration do - ENV['PUPPET_REFERENCES_HOSTNAME'] = "(the system's fully qualified hostname)" - ENV['PUPPET_REFERENCES_DOMAIN'] = "(the system's own domain)" - body = puppet_doc('configuration') generate_reference('configuration', CONFIGURATION_ERB, body, CONFIGURATION_MD) end