[patch] MaaS: fabric ID from CIDR
[fuel.git] / mcp / reclass / classes / cluster / mcp-pike-common-ha / infra / maas_pdf.yml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- set cluster_arch = [] %}
9 {%- for node in conf.nodes %}
10   {%- if node.node.arch not in cluster_arch %}
11     {%- do cluster_arch.append(node.node.arch) %}
12   {%- endif %}
13 {%- endfor %}
14 {%- set net_admin = [conf.idf.net_config.admin.network,
15                      conf.idf.net_config.admin.mask] | join("/") %}
16 ---
17 parameters:
18   maas:
19     region:
20       subnets:
21         {{ net_admin }}:
22           name: {{ net_admin }}
23           cidr: {{ net_admin }}
24           gateway_ip: ${_param:single_address}
25           fabric: fabric-2
26           iprange:
27             start: ${_param:opnfv_infra_maas_pxe_start_address}
28             end: ${_param:opnfv_infra_maas_pxe_end_address}
29             type: dynamic
30           vlan:
31             0:
32               description: "VLAN 0"
33               dhcp: true
34       # Space-separated list of dpkg architectures to be supported by MaaS
35       opnfv_arches:{%- for arch in cluster_arch %} {{ arch | dpkg_arch }}{%- endfor %}
36       sshprefs:
37         - '{{ conf.MAAS_SSH_KEY }}'
38 {%- if 'aarch64' in cluster_arch %}
39       package_repositories:
40         armband:
41           name: armband
42           enabled: '1'
43           url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}'
44           distributions: '${_param:openstack_version}-armband'
45           components: 'main'
46           arches: 'arm64'
47           key: &armband_key |
48             -----BEGIN PGP PUBLIC KEY BLOCK-----
49             Version: GnuPG v2.0.14 (GNU/Linux)
50
51             mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM
52             qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz
53             SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq
54             mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg
55             BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P
56             ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE
57             ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JATgEEwECACICGwMGCwkIBwMC
58             BhUIAgkKCwQWAgMBAh4BAheABQJaY3bYAAoJEN6rkLp5irHRoQMH/0PYl0A/6eWw
59             nQ/szhEFrr76Ln6wA4vEO+PiuWj9kTkZM2NaCnkisrIuHSPIVvOLfFmztbE6sKGe
60             t+a2b7Jqw48DZ/gq508aZE4Q307ookxdCOrzIu/796hFO34yXg3sqZoJh3VmKIjY
61             4DL8yG1iAiQ5vOw3IFWQnATwIZUgaCcjmE7HGap+9ePuJfFuQ8mIG5cy28t8qocx
62             AB/B2tucfBMwomYxKqgbLI5AG7iSt58ajvrrNa9f8IX7Ihj/jiuXhUwX+geEp98K
63             IWVI1ftEthZvfBpZW4BS98J4z//dEPi31L4jb9RQXq3afF2RpXchDeUN85bW45nu
64             W/9PMAlgE/U=
65             =m+zE
66             -----END PGP PUBLIC KEY BLOCK-----
67 {%- endif %}
68       machines:
69       {%- set pxe_interface = conf.idf.net_config.admin.interface %}
70       {#- We only support exactly 5 nodes for now, hardcoded order #}
71       {%- set node_roles = ['kvm01', 'kvm02', 'kvm03', 'cmp001', 'cmp002'] %}
72       {%- for node in conf.nodes %}
73       {%- if node.node.type == 'baremetal' %}
74         {{ node_roles[loop.index0] }}:
75           interface:
76             mac: {{ node.interfaces[pxe_interface].mac_address }}
77           power_parameters:
78             power_address: {{ node.remote_management.address.rsplit('/')[0] }}
79             power_password: {{ node.remote_management.pass }}
80             power_type: {{ node.remote_management.type }}
81             power_user: {{ node.remote_management.user }}
82           architecture: {{ node.node.arch | dpkg_arch }}/generic
83           distro_series: xenial
84           hwe_kernel: ${_param:hwe_kernel}
85           {%- if loop.index0 >= node_roles.index('cmp001')  %}
86           disk_layout:
87             type: lvm
88             root_device: sda
89             volume_group: vgroot
90             volume_name: lvroot
91             volume_size: 100
92           {%- endif %}
93       {%- endif %}
94       {%- endfor %}