Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler.rb: Switch to modern facts #2878

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ruby/puppetserver-lib/puppet/server/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def set_server_facts
@server_facts['serverversion'] = Puppet.version.to_s

# And then add the server name and IP
{ 'servername' => 'fqdn',
'serverip' => 'ipaddress',
'serverip6' => 'ipaddress6'
{ 'servername' => 'networking.fqdn',
'serverip' => 'networking.ip',
'serverip6' => 'networking.ip6'
}.each do |var, fact|
value = Facter.value(fact)
if value
Expand All @@ -250,10 +250,10 @@ def set_server_facts
end

if @server_facts['servername'].nil?
host = Facter.value(:hostname)
host = Facter.value('networking.hostname')
if host.nil?
Puppet.warning _("Could not retrieve fact servername")
elsif domain = Facter.value(:domain)
elsif domain = Facter.value('networking.domain')
@server_facts['servername'] = [host, domain].join('.')
else
@server_facts['servername'] = host
Expand Down
Loading