diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-02-04 04:42:58 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-02-13 18:14:56 +0100 |
commit | bfc61428e35c92cbed253e98133d7891cc2d6833 (patch) | |
tree | fa9005577c2a9011430b758a5168729060d08e1b /mcp | |
parent | 6771512ac2a9402e61976140d1f0cef6d8944cf9 (diff) |
reclass: maas: Dynamic machine definitions
Refactor maas machine definition flow from going through variables
in pod_config.yaml to directly handling it in Fuel using a new j2
template.
This prepares for future improvements allowing a dynamic compute
node count, as well as parameterizing new values via j2.
For now, node roles and count are still statically mapped to PDF
nodes.
JIRA: FUEL-319
Change-Id: I770d82987fcb99792f9d5bc0857ab513f5cd3731
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp')
-rw-r--r-- | mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas.yml | 57 | ||||
-rw-r--r-- | mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 | 30 |
2 files changed, 31 insertions, 56 deletions
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas.yml index 1fd5987b8..5d6012488 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas.yml +++ b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas.yml @@ -10,6 +10,7 @@ classes: - system.maas.region.single - service.maas.cluster.single - cluster.mcp-pike-common-ha.infra.lab_proxy_pdf + - cluster.mcp-pike-common-ha.infra.maas_pdf parameters: _param: dhcp_interface: ${_param:opnfv_fn_vm_primary_interface} @@ -54,62 +55,6 @@ parameters: vid: 0 dhcp_on: true primary_rack: ${_param:infra_maas_node01_hostname} - machines: - kvm01: - interface: - mac: ${_param:opnfv_maas_node01_interface_mac} - power_parameters: - power_address: ${_param:opnfv_maas_node01_power_address} - power_password: ${_param:opnfv_maas_node01_power_password} - power_type: ${_param:opnfv_maas_node01_power_type} - power_user: ${_param:opnfv_maas_node01_power_user} - architecture: ${_param:opnfv_maas_node01_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} - kvm02: - interface: - mac: ${_param:opnfv_maas_node02_interface_mac} - power_parameters: - power_address: ${_param:opnfv_maas_node02_power_address} - power_password: ${_param:opnfv_maas_node02_power_password} - power_type: ${_param:opnfv_maas_node02_power_type} - power_user: ${_param:opnfv_maas_node02_power_user} - architecture: ${_param:opnfv_maas_node02_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} - kvm03: - interface: - mac: ${_param:opnfv_maas_node03_interface_mac} - power_parameters: - power_address: ${_param:opnfv_maas_node03_power_address} - power_password: ${_param:opnfv_maas_node03_power_password} - power_type: ${_param:opnfv_maas_node03_power_type} - power_user: ${_param:opnfv_maas_node03_power_user} - architecture: ${_param:opnfv_maas_node03_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} - cmp001: - interface: - mac: ${_param:opnfv_maas_node04_interface_mac} - power_parameters: - power_address: ${_param:opnfv_maas_node04_power_address} - power_password: ${_param:opnfv_maas_node04_power_password} - power_type: ${_param:opnfv_maas_node04_power_type} - power_user: ${_param:opnfv_maas_node04_power_user} - architecture: ${_param:opnfv_maas_node04_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} - cmp002: - interface: - mac: ${_param:opnfv_maas_node05_interface_mac} - power_parameters: - power_address: ${_param:opnfv_maas_node05_power_address} - power_password: ${_param:opnfv_maas_node05_power_password} - power_type: ${_param:opnfv_maas_node05_power_type} - power_user: ${_param:opnfv_maas_node05_power_user} - architecture: ${_param:opnfv_maas_node05_architecture} - distro_series: xenial - hwe_kernel: ${_param:hwe_kernel} cluster: saltstack_repo_xenial: "http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.11/ xenial main" linux: diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 new file mode 100644 index 000000000..a875993e3 --- /dev/null +++ b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 @@ -0,0 +1,30 @@ +############################################################################## +# Copyright (c) 2018 Mirantis Inc., Enea AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +--- +parameters: + maas: + region: + 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] }}: + interface: + mac: {{ node.interfaces[pxe_interface].mac_address }} + power_parameters: + power_address: {{ node.remote_management.address.rsplit('/')[0] }} + power_password: {{ node.remote_management.pass }} + power_type: {{ node.remote_management.type }} + power_user: {{ node.remote_management.user }} + architecture: {{ node.node.arch | dpkg_arch }}/generic + distro_series: xenial + hwe_kernel: ${_param:hwe_kernel} + {%- endif %} + {%- endfor %} |