{% for role in topology_map %} {% set role_count = topology_map[role].scale |default(0) %} {% set role_profile = topology_map[role].flavor |default('') %} {% set role_networks = topology_map[role].networks |default([]) %} {% set network_config = topology_map[role].network_config |default('') %} {% set growvols_args = topology_map[role].growvols_args |default('') %} {% if role_count %} - name: {{ role }} count: {{ role_count }} {% if 'Controller' in role %} {# (jbadiapa) The to_json | from_json is due to the ansible issue at #} {# https://github.com/ansible/ansible/issues/27299 #} {% if ( baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:control')].name")| length > 0 ) %} instances: {% for instance in range (role_count): %} - hostname: {{stack_name}}-{{role|lower}}-{{instance}} name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:control')].name"))[instance] }} {% endfor %} {% endif %} {% elif 'Compute' in role %} {% if (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:compute')].name")| length > 0 ) %} instances: {% for instance in range (role_count): %} - hostname: {{stack_name}}-{{role|lower}}-{{instance}} name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:compute')].name"))[instance] }} {% endfor %} {% endif %} {% elif 'Ceph' in role %} {% if ( baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:ceph')].name")| length > 0 ) %} instances: {% for instance in range (role_count): %} - hostname: {{stack_name}}-{{role|lower}}-{{instance}} name: {{ (baremetal_instackenv | to_json | from_json | json_query("nodes[?contains(capabilities, 'profile:ceph')].name"))[instance] }} {% endfor %} {% endif %} {% endif %} {% if role_profile or (network_config and network_provision|bool) or (role_networks and network_isolation and network_provision|bool) %} defaults: {% endif %} {% if role_profile %} profile: {{ role_profile }} {% endif %} {% if role_networks and network_isolation and network_provision|bool %} networks: {{ role_networks | to_nice_yaml(indent=2) | indent(6)}} {% endif %} {% if network_config and network_provision|bool %} network_config: {{ network_config | to_nice_yaml(indent=2) | indent(6)}} {% endif %} {% if growvols_args and release not in ['train'] %} ansible_playbooks: - playbook: /usr/share/ansible/tripleo-playbooks/cli-overcloud-node-growvols.yaml extra_vars: growvols_args: {{ growvols_args }} {% endif %} {% endif %} {% endfor %}