Comment 2 for bug 1660996

Revision history for this message
Logan V (loganv) wrote :

Testing out the old jinja removed here https://github.com/openstack/openstack-ansible/commit/518fb381c49a04e2b8af4a7e623e698482033efc I get the expected output:

known_container_hosts: >
  {% set _var = [] -%}
  {% for item in groups['all_containers'] -%}
  {% if hostvars[item]['physical_host'] | default(false) != item -%}
  {% if _var.append(hostvars[item]['physical_host']) -%}
  {% endif -%}
  {% endif -%}
  {% endfor -%}
  {{ _var | unique }}

ubuntu@deploy-devcloud:playbooks$ ansible localhost -m debug -a msg="{{ known_container_hosts }}"
localhost | SUCCESS => {
    "msg": [
        "lsn-mc1008",
        "lsn-mc1007",
        "lsn-mc1006"
    ]
}