[EVO] Utiliser l'inventaire d'ansible

This commit is contained in:
2023-09-22 17:25:03 +02:00
parent b9baf12530
commit b656ce9f66
2 changed files with 21 additions and 0 deletions

6
templates/hosts.conf.j2 Normal file
View File

@@ -0,0 +1,6 @@
# {{ ansible_managed }}
{% for ip in dnsmasq_host_ips %}
{% set hostnames = [hostvars[host]['inventory_hostname']] + [hostvars[host]['inventory_hostname_short']] + dnsmasq_host_aliases %}
{{ ip }} {{ hostnames | select() | join(' ') }}
{% endfor %}