tripleo-quickstart/roles/tripleo-inventory/templates/inventory.j2

37 lines
1.3 KiB
Django/Jinja

# BEGIN Autogenerated hosts
{% for host in groups['all'] %}
{% if hostvars[host].get('ansible_connection', '') == 'local' %}
{{ host }} ansible_connection=local
{% else %}
{{ host }}{% if 'ansible_host' in hostvars[host]
%} ansible_host={{ hostvars[host]['ansible_host'] }}{% endif %}
{% if 'private_v4' in hostvars[host]
%} private_v4={{ hostvars[host]['private_v4'] }}{% endif %}
{% if 'public_v4' in hostvars[host]
%} public_v4={{ hostvars[host]['public_v4'] }}{% endif %}
{% if 'ansible_user' in hostvars[host]
%} ansible_user={{ hostvars[host]['ansible_user'] }}{% endif %}
{% if 'ansible_private_key_file' in hostvars[host]
%} ansible_private_key_file={{ hostvars[host]['ansible_private_key_file'] }}{% endif %}
{% if 'undercloud_ip' in hostvars[host]
%} undercloud_ip={{ hostvars[host]['undercloud_ip'] }}{% endif %}
{% if 'ansible_ssh_extra_args' in hostvars[host]
%} ansible_ssh_extra_args={{ hostvars[host]['ansible_ssh_extra_args']|quote }}{% endif %}
{% endif %}
{% endfor %}
# END autogenerated hosts
# BEGIN Autogenerated groups
{% for group in groups %}
{% if group not in ['ungrouped', 'all'] and not (groups[group]|length == 1 and groups[group][0] == group) %}
[{{ group }}]
{% for host in groups[group] %}
{{ host }}
{% endfor %}
{% endif %}
{% endfor %}
# END Autogenerated groups