[fuel] Skip baremetal cmp cfg if scenario lacks it
[pharos.git] / config / installers / fuel / pod_config.yml.j2
index edb63ee..7f53b59 100644 (file)
@@ -13,9 +13,10 @@ parameters:
     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 #}