k3s-io / k3s-ansible

Apache License 2.0
2.01k stars 802 forks source link

Use inventory_hostname instead of ansible_hostname #274

Closed pallxk closed 9 months ago

pallxk commented 9 months ago

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

Linked Issues

None.