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

Do not rely on legacy facts #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bastelfreak
Copy link

No description provided.

@bastelfreak bastelfreak requested review from a team as code owners June 25, 2024 16:44
domain = Facter.value(:domain)
networking = Facter.value(:networking)
hostname = networking[:hostname]
domain = networking[:domain]
if domain and domain != ''
fqdn = [hostname, domain].join('.')
Copy link
Author

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?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bastelfreak bastelfreak changed the title Face: do not rely on legacy facts Do not rely on legacy facts Jun 26, 2024
Copy link

@smortex smortex left a 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('.')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants