[EVO] Utiliser l'inventaire d'ansible

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

View File

@@ -0,0 +1,15 @@
# {{ ansible_managed }}
{% for ip in dnsmasq_host_ips %}
{% endfor %}
{% set last_host = groups['all'] | last %}
{% for host in groups['all'] %}
{% set hostnames = [hostvars[host]['inventory_hostname']] + [hostvars[host]['inventory_hostname_short']] + hostvars[host]['dnsmasq_host_aliases'] %}
{% for ip in hostvars[host]['dnsmasq_host_ips'] %}
{{ ip }} {{ hostnames | select() | join(' ') }}
{% endfor %}
{% if host != last_host %}
{% endif %}
{% endfor %}