Skip to content

Commit 1a9544e

Browse files
committed
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.
1 parent c0efabb commit 1a9544e

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Diff for: lib/puppet/reference/configuration.rb

+4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
val = '$confdir/hiera.yaml. However, for backwards compatibility, if a file exists at $codedir/hiera.yaml, Puppet uses that instead.'
4242
when 'certname'
4343
val = "the Host's fully qualified domain name, as determined by Facter"
44+
when 'hostname'
45+
val = "(the system's fully qualified hostname)"
46+
when 'domain'
47+
val = "(the system's own domain)"
4448
when 'srv_domain'
4549
val = 'example.com'
4650
when 'http_user_agent'

Diff for: lib/puppet/settings.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ def self.default_certname
8181
end
8282

8383
def self.hostname_fact
84-
ENV['PUPPET_REFERENCES_HOSTNAME'] || Puppet.runtime[:facter].value('networking.hostname')
84+
Puppet.runtime[:facter].value('networking.hostname')
8585
end
8686

8787
def self.domain_fact
88-
ENV['PUPPET_REFERENCES_DOMAIN'] || Puppet.runtime[:facter].value('networking.domain')
88+
Puppet.runtime[:facter].value('networking.domain')
8989
end
9090

9191
def self.default_config_file_name

Diff for: rakelib/generate_references.rake

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ end
4141
namespace :references do
4242
desc "Generate configuration reference"
4343
task :configuration do
44-
ENV['PUPPET_REFERENCES_HOSTNAME'] = "(the system's fully qualified hostname)"
45-
ENV['PUPPET_REFERENCES_DOMAIN'] = "(the system's own domain)"
46-
4744
body = puppet_doc('configuration')
4845
generate_reference('configuration', CONFIGURATION_ERB, body, CONFIGURATION_MD)
4946
end

0 commit comments

Comments
 (0)