7d338dd022070b76317f3df1dbe5cb438d2cb8ca
[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       fabrics:
31         fabric-2:
32           description: "Fabric Admin"
33           vlan:
34             0:
35               description: "VLAN 0"
36               dhcp: true
37       # Space-separated list of dpkg architectures to be supported by MaaS
38       opnfv_arches:{%- for arch in cluster_arch %} {{ arch | dpkg_arch }}{%- endfor %}
39       sshprefs:
40         - '{{ conf.MAAS_SSH_KEY }}'
41 {%- if 'aarch64' in cluster_arch %}
42       package_repositories:
43         armband:
44           name: armband
45           enabled: '1'
46           url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}'
47           distributions: '${_param:openstack_version}-armband'
48           components: 'main'
49           arches: 'arm64'
50           key: &armband_key |
51             -----BEGIN PGP PUBLIC KEY BLOCK-----
52             Version: GnuPG v2.0.14 (GNU/Linux)
53
54             mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM
55             qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz
56             SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq
57             mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg
58             BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P
59             ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE
60             ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JATgEEwECACICGwMGCwkIBwMC
61             BhUIAgkKCwQWAgMBAh4BAheABQJaY3bYAAoJEN6rkLp5irHRoQMH/0PYl0A/6eWw
62             nQ/szhEFrr76Ln6wA4vEO+PiuWj9kTkZM2NaCnkisrIuHSPIVvOLfFmztbE6sKGe
63             t+a2b7Jqw48DZ/gq508aZE4Q307ookxdCOrzIu/796hFO34yXg3sqZoJh3VmKIjY
64             4DL8yG1iAiQ5vOw3IFWQnATwIZUgaCcjmE7HGap+9ePuJfFuQ8mIG5cy28t8qocx
65             AB/B2tucfBMwomYxKqgbLI5AG7iSt58ajvrrNa9f8IX7Ihj/jiuXhUwX+geEp98K
66             IWVI1ftEthZvfBpZW4BS98J4z//dEPi31L4jb9RQXq3afF2RpXchDeUN85bW45nu
67             W/9PMAlgE/U=
68             =m+zE
69             -----END PGP PUBLIC KEY BLOCK-----
70 {%- endif %}
71       machines:
72       {%- set pxe_interface = conf.idf.net_config.admin.interface %}
73       {#- We only support exactly 5 nodes for now, hardcoded order #}
74       {%- set node_roles = ['kvm01', 'kvm02', 'kvm03', 'cmp001', 'cmp002'] %}
75       {%- for node in conf.nodes %}
76       {%- if node.node.type == 'baremetal' %}
77         {{ node_roles[loop.index0] }}:
78           interface:
79             mac: {{ node.interfaces[pxe_interface].mac_address }}
80           power_parameters:
81             power_address: {{ node.remote_management.address.rsplit('/')[0] }}
82             power_password: {{ node.remote_management.pass }}
83             power_type: {{ node.remote_management.type }}
84             power_user: {{ node.remote_management.user }}
85           architecture: {{ node.node.arch | dpkg_arch }}/generic
86           distro_series: xenial
87           hwe_kernel: ${_param:hwe_kernel}
88           {%- if loop.index0 >= node_roles.index('cmp001')  %}
89           disk_layout:
90             type: lvm
91             root_device: sda
92             volume_group: vgroot
93             volume_name: lvroot
94             volume_size: 100
95           {%- endif %}
96       {%- endif %}
97       {%- endfor %}