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

Use inventory_hostname instead of ansible_hostname #274

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

pallxk
Copy link
Contributor

@pallxk pallxk commented Dec 11, 2023

Changes

Use inventory_hostname instead of ansible_hostname.

It appears to me that the intention is to check if current host is the first one in the group, then I think it's best to use inventory_hostname as it will always work and also doesn't depend on gather_facts.

ansible_hostname will not work when the host as specified in inventory does not match the hostname discovered on server because of

  • FQDN vs. not fully qualified;
  • alias in ~/.ssh/config;
  • DNS CNAME;
  • or simply it's different on DNS from on server.

Linked Issues

None.

@dereknola dereknola merged commit 1527df5 into k3s-io:master Dec 11, 2023
2 checks passed
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.

2 participants