# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
{%- import 'net_map.j2' as nm with context %}
+{%- set cluster = {'has_virtual_nodes': False} %}
{%- for node in conf.nodes %}
- {%- if node.node.type == 'baremetal' %}
- {%- set cluster_has_baremetal_nodes = True %}
+ {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %}
+ {%- set _ = cluster.update({'has_baremetal_nodes': True}) %}
{%- endif %}
{%- endfor %}
---
cluster:
domain: mcp-pike-ovs-novcp-ha.local
states:
-{%- if cluster_has_baremetal_nodes %}
+{%- if cluster.has_baremetal_nodes %}
- maas
- baremetal_init
{%- endif %}
virtual:
nodes:
- cfg01
-{%- if cluster_has_baremetal_nodes %}
+{%- if cluster.has_baremetal_nodes %}
- mas01
{%- endif %}
{#- Most likely, controllers will always have the same type and number (3) #}