-
Notifications
You must be signed in to change notification settings - Fork 24
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
Do not rely on legacy facts #121
base: main
Are you sure you want to change the base?
Conversation
domain = Facter.value(:domain) | ||
networking = Facter.value(:networking) | ||
hostname = networking[:hostname] | ||
domain = networking[:domain] | ||
if domain and domain != '' | ||
fqdn = [hostname, domain].join('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be easier to always use the networking.fqdn fact? I think when there's no domain, facter will set the fqdn to the hostname?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im assuming this was copied from puppet https://github.com/puppetlabs/puppet/blob/7739378f6fa840d6dbee237132754c64f94cc38a/lib/puppet/settings.rb#L72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving away of legacy facts seems a good move. As you say, this can probably use the networking.fqdn
fact directly.
domain = Facter.value(:domain) | ||
networking = Facter.value(:networking) | ||
hostname = networking[:hostname] | ||
domain = networking[:domain] | ||
if domain and domain != '' | ||
fqdn = [hostname, domain].join('.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems reasonable.
No description provided.