Some upcoming scenarios do not define any compute nodes, so
skip adding the nodes to MaaS machine list too.
Change-Id: I895d8c7cb54783a57667d20f672b8ff870105cfc
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
region:
machines:
{%- set ctl_roles = 3 if 'virtual' not in conf else conf.virtual.nodes.control | length %}
+ {%- set has_cmp = True if 'virtual' not in conf else 'compute' in conf.virtual.nodes %}
{%- for node in conf.nodes %}
{%- if (node.node.type == 'baremetal' and (
- loop.index > nm.cmp001.idx or loop.index0 < ctl_roles)) %}
+ (has_cmp and loop.index > nm.cmp001.idx) or loop.index0 < ctl_roles)) %}
{%- if loop.index > nm.cmp001.idx %}
cmp{{ '%03d' | format(loop.index - nm.cmp001.idx) }}:
{%- elif 'virtual' not in conf %} {#- strictly for Pharos verify job #}