We make almost no use of the dynamic properties of the hcloud inventory,
so we can simplify this by declaring all cloud servers in the main hosts
inventory.
The main benefit of this change is that temporary and experimental cloud
servers are not automatically included in the Ansible playbooks. In such
cases it is usually incorrect to deploy changes to these unknown servers.
A smaller side benefit is that Ansible will now use hostnames to connect
to cloud servers, whereas the dynamic inventory provided IPv4 addresses.
This results in more meaningful ~/.ssh/known_hosts entries.
As per the following deprecation warning (even though it has a typo):
[DEPRECATION WARNING]: [defaults]callback_whitelist option, normalizing
names to new standard, use callback_enabled instead. This feature will
be removed from ansible-core in version 2.15. Deprecation warnings can
be disabled by setting deprecation_warnings=False in ansible.cfg.
[1] https://github.com/ansible/ansible/pull/74845
This has multiple benefits:
- We don't have to wait until Ansible 2.8 (which will be when the official hcloud dynamic inventory provider will be included)
- We can expand the script to group servers by labels if required
- We can use the vault to automatically get the hetzner cloud token which is not possible otherwise