Pass though host variables from kayobe to kolla-ansible inventory

By default this includes:

* ansible_host
* ansible_port
* ansible_ssh_private_key_file
This commit is contained in:
Mark Goddard 2017-09-07 20:44:05 +01:00
parent c576e4d486
commit a27e0740fa
2 changed files with 8 additions and 1 deletions

View File

@ -56,6 +56,13 @@ kolla_overcloud_inventory_top_level_group_map: {}
# have no hosts mapped to them will be provided with an empty group definition. # have no hosts mapped to them will be provided with an empty group definition.
kolla_overcloud_inventory_kolla_top_level_groups: [] kolla_overcloud_inventory_kolla_top_level_groups: []
# List of names of host variables to pass through from kayobe hosts to
# kolla-ansible hosts, if set.
kolla_overcloud_inventory_pass_through_host_vars:
- "ansible_host"
- "ansible_port"
- "ansible_ssh_private_key_file"
############################################################################### ###############################################################################
# Kolla-ansible global configuration options. # Kolla-ansible global configuration options.

View File

@ -17,7 +17,7 @@
# These hostnames must be resolvable from your deployment host # These hostnames must be resolvable from your deployment host
{% for host in groups[group] %} {% for host in groups[group] %}
{% set host_hv=hostvars[host] %} {% set host_hv=hostvars[host] %}
{{ host }}{% if "ansible_host" in host_hv %} ansible_host={{ host_hv["ansible_host"] }}{% endif %} {{ host }}{% for hv_name in kolla_overcloud_inventory_pass_through_host_vars %}{% if hv_name in host_hv %} {{ hv_name }}={{ host_hv[hv_name] }}{% endif %}{% endfor %}
{% endfor %} {% endfor %}