summaryrefslogtreecommitdiffstats
path: root/mcp
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-01 23:45:16 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-08-01 23:46:18 +0200
commitb12c7e33ec1e317a2756e05d9fc3fb48a6a90bd7 (patch)
treef5fd7a2af9b9d72bd332c71132db93297ef54145 /mcp
parenta9ad0da2d480a47d83cb26c03574cfdcee84b647 (diff)
[maas] Allow more than two compute nodes
Change-Id: Ie023bfe7b322a49a8b525e7926518c94899c67ce Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp')
-rw-r--r--mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j210
1 files changed, 6 insertions, 4 deletions
diff --git a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2 b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2
index ae59316bd..b2d7cefad 100644
--- a/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2
+++ b/mcp/reclass/classes/cluster/mcp-common-ha/infra/maas.yml.j2
@@ -108,11 +108,13 @@ parameters:
{%- endif %}
machines:
{%- set pxe_interface = conf.idf.net_config.admin.interface %}
- {#- We only support exactly 5 nodes for now, hardcoded order #}
- {%- set node_roles = ['kvm01', 'kvm02', 'kvm03', 'cmp001', 'cmp002'] %}
{%- for node in conf.nodes %}
{%- if node.node.type == 'baremetal' %}
- {{ node_roles[loop.index0] }}:
+ {%- if loop.index > nm.cmp001.idx %}
+ cmp{{ '%03d' | format(loop.index - nm.cmp001.idx) }}:
+ {%- else %}
+ kvm{{ '%02d' | format(loop.index) }}:
+ {%- endif %}
interface:
mac: {{ node.interfaces[pxe_interface].mac_address }}
power_parameters:
@@ -123,7 +125,7 @@ parameters:
architecture: {{ node.node.arch | dpkg_arch }}/generic
distro_series: xenial
hwe_kernel: ${_param:hwe_kernel}
- {%- if loop.index0 >= node_roles.index('cmp001') %}
+ {%- if loop.index > nm.cmp001.idx %}
disk_layout:
type: lvm
root_device: sda