diff --git a/ansible/roles/kolla-ansible/defaults/main.yml b/ansible/roles/kolla-ansible/defaults/main.yml index 8db76a0775e68dbe5faa2267997baa49e6fbcecf..0321ab6cf11ac40fdbf420b631e18ebd8c0c598c 100644 --- a/ansible/roles/kolla-ansible/defaults/main.yml +++ b/ansible/roles/kolla-ansible/defaults/main.yml @@ -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. 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. diff --git a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 index 99e55f2aef7e39001340b81d7a395faeab009cd6..0d213eb3eea2e74307b517164ae7afb454458033 100644 --- a/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 +++ b/ansible/roles/kolla-ansible/templates/overcloud-top-level.j2 @@ -17,7 +17,7 @@ # These hostnames must be resolvable from your deployment host {% for host in groups[group] %} {% 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 %}