ovh / the-bastion-ansible-wrapper

Using Ansible through The Bastion
https://ovh.github.io/the-bastion/
Apache License 2.0
35 stars 12 forks source link

fix: Detect hostvars with hostname #9

Closed jouir closed 2 years ago

jouir commented 2 years ago

When using the Ansible inventory, hostvars were expected to be found with the ansible_host variable (IP address or whatever), which is not always the case. With a basic inventory, when ansible_host is not defined, the hostname is used. This commit ensures hostvars can be found with the hostname (key) or with the ansible_host variable in the inventory.