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/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 | |
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/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2')
-rw-r--r-- | mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/maas_pdf.yml.j2 | 30 |
1 files changed, 30 insertions, 0 deletions
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 %} |