7ee1aa13fbf5b11370366922ea6d661059a167f7
[fuel.git] / mcp / reclass / classes / cluster / all-mcp-arch-common / infra / maas.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 {%- import 'net_map.j2' as nm with context %}
9 ---
10 # NOTE: pod_config is generated and transferred into its final location on
11 # cfg01 only during deployment to prevent leaking sensitive data
12 classes:
13   - system.maas.region.single
14   - service.maas.cluster.single
15   - cluster.all-mcp-arch-common.opnfv.lab_proxy_pdf
16   - cluster.all-mcp-arch-common.opnfv.pod_config
17 parameters:
18   _param:
19     mcpcontrol_interface: ${_param:opnfv_fn_vm_primary_interface}
20     primary_interface: ${_param:opnfv_fn_vm_secondary_interface}
21     pxe_admin_interface: ${_param:opnfv_fn_vm_tertiary_interface}
22     interface_mtu: 1500
23     # MaaS has issues using MTU > 1500 for PXE interface
24     pxe_admin_interface_mtu: 1500
25     linux_system_codename: xenial
26     maas_admin_username: opnfv
27     maas_admin_password: opnfv_secret
28     maas_db_password: opnfv_secret
29     dns_server01: '{{ nm.dns_public[0] }}'
30     single_address: ${_param:infra_maas_node01_deploy_address}
31     hwe_kernel: 'hwe-16.04'
32     opnfv_maas_timeout_comissioning: {{ nm.maas_timeout_comissioning }}
33     opnfv_maas_timeout_deploying: {{ nm.maas_timeout_deploying }}
34   maas:
35     region:
36       boot_sources_delete_all_others: true
37       boot_sources:
38         resources_mirror:
39           url: http://images.maas.io/ephemeral-v3/daily
40           keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
41       boot_sources_selections:
42         xenial:
43           url: "http://images.maas.io/ephemeral-v3/daily"
44           os: "ubuntu"
45           release: "${_param:linux_system_codename}"
46           arches:
47 {%- for arch in nm.cluster.arch %}
48             - "{{ arch | dpkg_arch }}"
49 {%- endfor %}
50           subarches:
51             - "generic"
52             - "ga-16.04"
53             - "hwe-16.04"
54           labels: '"*"'
55       fabrics:
56         pxe_admin:
57           name: 'pxe_admin'
58           description: Fabric for PXE/admin
59           vlans:
60             0:
61               name: 'vlan 0'
62               description: PXE/admin VLAN
63               dhcp: true
64               primary_rack: "${linux:network:hostname}"
65       subnets:
66         {{ nm.net_admin }}:
67           name: {{ nm.net_admin }}
68           cidr: {{ nm.net_admin }}
69           gateway_ip: ${_param:single_address}
70           fabric: ${maas:region:fabrics:pxe_admin:name}
71           vlan: 0
72           ipranges:
73             1:
74               start: {{ nm.net_admin_pool_start }}
75               end: {{ nm.net_admin_pool_end }}
76               type: dynamic
77       sshprefs:
78         - '{{ conf.MAAS_SSH_KEY }}'
79 {%- if 'aarch64' in nm.cluster.arch %}
80       package_repositories:
81         armband:
82           name: armband
83           enabled: '1'
84           url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}'
85           distributions: '${_param:openstack_version}-armband'
86           components: 'main'
87           arches: 'arm64'
88           key: &armband_key |
89             -----BEGIN PGP PUBLIC KEY BLOCK-----
90             Version: GnuPG v2.0.14 (GNU/Linux)
91
92             mQENBFagAroBCADWboNIjuF6lB1mWv2+EbvqY3lKl5mLKhr2DnSUkKeHUPBv8gNM
93             qK8Q00AMIyPiyEhgjA+dWizZ+5aBgxoiY7oMeLJ2Xym36U/8SYq2BWd3SGCbMNoz
94             SJDxDUSM/HFVs6atF1M3DY9oN65hSVnu4uy5Tu6asf6k4rhAyk0z4+pRcPBCu2vq
95             mnGi3COM/+9PShrEKeVOx5W2vRJywUFuq8EDvQnRoJ0GvM28JiJIanw17YwIPxhg
96             BKZVpZjan5X+ihVMXwA2h/G/FS5Omhd50RqV6LWSYs94VJJgYqHx8UMm7izcxI+P
97             ct3IcbD195bPbJ+SbuiFe45ZLsdY1MyGiU2BABEBAAG0K0VuZWEgQXJtYmFuZCBE
98             ZXZvcHMgVGVhbSA8YXJtYmFuZEBlbmVhLmNvbT6JATgEEwECACICGwMGCwkIBwMC
99             BhUIAgkKCwQWAgMBAh4BAheABQJaY3bYAAoJEN6rkLp5irHRoQMH/0PYl0A/6eWw
100             nQ/szhEFrr76Ln6wA4vEO+PiuWj9kTkZM2NaCnkisrIuHSPIVvOLfFmztbE6sKGe
101             t+a2b7Jqw48DZ/gq508aZE4Q307ookxdCOrzIu/796hFO34yXg3sqZoJh3VmKIjY
102             4DL8yG1iAiQ5vOw3IFWQnATwIZUgaCcjmE7HGap+9ePuJfFuQ8mIG5cy28t8qocx
103             AB/B2tucfBMwomYxKqgbLI5AG7iSt58ajvrrNa9f8IX7Ihj/jiuXhUwX+geEp98K
104             IWVI1ftEthZvfBpZW4BS98J4z//dEPi31L4jb9RQXq3afF2RpXchDeUN85bW45nu
105             W/9PMAlgE/U=
106             =m+zE
107             -----END PGP PUBLIC KEY BLOCK-----
108 {%- endif %}
109       machines:
110       {%- set pxe_interface = conf.idf.net_config.admin.interface %}
111       {%- set ctl_roles = conf.virtual.nodes.control | length %}
112       {%- for node in conf.nodes %}
113       {%- if (node.node.type == 'baremetal' and (
114               loop.index > nm.cmp001.idx or loop.index0 < ctl_roles)) %}
115         {%- if loop.index > nm.cmp001.idx %}
116         cmp{{ '%03d' | format(loop.index - nm.cmp001.idx) }}:
117         {%- else %}
118         {{ conf.virtual.nodes.control[loop.index0] }}:
119         {%- endif %}
120           interface:
121             mac: {{ node.interfaces[pxe_interface].mac_address }}
122           power_parameters:
123             power_address: {{ node.remote_management.address.rsplit('/')[0] }}
124             power_password: {{ node.remote_management.pass }}
125             power_type: {{ node.remote_management.type }}
126             power_user: {{ node.remote_management.user }}
127           architecture: {{ node.node.arch | dpkg_arch }}/generic
128           distro_series: xenial
129           hwe_kernel: ${_param:hwe_kernel}
130           {%- if loop.index > nm.cmp001.idx %}
131           disk_layout:
132             type: lvm
133             root_device: sda
134             volume_group: vgroot
135             volume_name: lvroot
136             volume_size: 100
137           {%- endif %}
138       {%- endif %}
139       {%- endfor %}
140       salt_master_ip: ${_param:reclass_config_master}
141       domain: ${_param:cluster_domain}
142       maas_config:
143         commissioning_distro_series: 'xenial'
144         default_distro_series: 'xenial'
145         default_osystem: 'ubuntu'
146         default_storage_layout: 'lvm'
147         enable_http_proxy: true
148         disk_erase_with_secure_erase: false
149         dnssec_validation: 'no'
150         enable_third_party_drivers: true
151         network_discovery: 'enabled'
152         default_min_hwe_kernel: ${_param:hwe_kernel}
153     cluster:
154       saltstack_repo_xenial: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
155   linux:
156     network:
157       interface:
158         mcpcontrol_interface:
159           enabled: true
160           name: ${_param:mcpcontrol_interface}
161           type: eth
162           proto: dhcp
163         primary_interface:
164           enabled: true
165           name: ${_param:primary_interface}
166           type: eth
167 {%- if conf.idf.fuel.jumphost.get('trunks', {}).get('mgmt', False) and (nm.vlan_mgmt | int > 0) %}
168           proto: manual
169           mtu: ${_param:interface_mtu}
170         primary_interface_vlan:
171           enabled: true
172           type: vlan
173           name: ${_param:primary_interface}.{{ nm.vlan_mgmt }}
174           use_interfaces:
175             - ${_param:primary_interface}
176 {%- endif %}
177           proto: static
178           mtu: ${_param:interface_mtu}
179           address: ${_param:infra_maas_node01_address}
180           netmask: ${_param:opnfv_net_mgmt_mask}
181         pxe_admin_interface:
182           enabled: true
183           name: ${_param:pxe_admin_interface}
184           mtu: ${_param:pxe_admin_interface_mtu}
185           proto: static
186           address: ${_param:single_address}
187           netmask: ${_param:opnfv_net_admin_mask}
188           type: eth