Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
richm committed Feb 4, 2025
1 parent 5276ee8 commit 7bed8d0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/inventory.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
all:
hosts:
{% for host in hostvars.keys() | reject("match", "^localhost") %}
{{ host }}:
{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses",
{{ inventory_hostname }}:
{% for key in ["ansible_all_ipv4_addresses", "ansible_all_ipv6_addresses",
"ansible_default_ipv4", "ansible_default_ipv6", "ansible_host",
"ansible_port", "ansible_ssh_common_args",
"ansible_ssh_private_key_file","ansible_user"] %}
{% if key in hostvars[host] %}
{{ key }}: {{ hostvars[host][key] }}
{% endif %}
{% endfor %}
{% if key in hostvars[inventory_hostname] %}
{{ key }}: {{ hostvars[inventory_hostname][key] }}
{% endif %}
{% endfor %}

0 comments on commit 7bed8d0

Please sign in to comment.