[EVO] Utiliser l'inventaire d'ansible

This commit is contained in:
2023-09-25 16:53:21 +02:00
parent b9baf12530
commit 6e48e05990
2 changed files with 33 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
# {{ 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']] + dnsmasq_host_aliases %}
{{ ip }} {{ hostnames | select() | join(' ') }}
{% if host != last_host %}
{% endif %}
{% endfor %}