Skip to content

Commit

Permalink
Hardcode hostname and domain
Browse files Browse the repository at this point in the history
Rather than introducing new environment variables, just hard code the
default value in the config reference like we do for others.
  • Loading branch information
joshcooper committed Sep 3, 2024
1 parent c0efabb commit 1a9544e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions lib/puppet/reference/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions lib/puppet/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions rakelib/generate_references.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1a9544e

Please sign in to comment.