40a14c4a622ee0b95d71d84913181ff48ef88618
[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     linux_system_codename: xenial
23     maas_admin_username: opnfv
24     dns_server01: '{{ nm.dns_public[0] }}'
25     pxe_admin_address: ${_param:infra_maas_node01_deploy_address}
26     single_address: ${_param:pxe_admin_address}
27     hwe_kernel: 'hwe-16.04'
28     opnfv_maas_timeout_comissioning: {{ nm.maas_timeout_comissioning }}
29     opnfv_maas_timeout_deploying: {{ nm.maas_timeout_deploying }}
30   maas:
31     region:
32       boot_sources_delete_all_others: true
33       boot_sources:
34         resources_mirror:
35           url: http://images.maas.io/ephemeral-v3/daily
36           keyring_file: /usr/share/keyrings/ubuntu-cloudimage-keyring.gpg
37       boot_sources_selections:
38         xenial:
39           url: "http://images.maas.io/ephemeral-v3/daily"
40           os: "ubuntu"
41           release: "${_param:linux_system_codename}"
42           arches:
43 {%- for arch in nm.cluster.arch %}
44             - "{{ arch | dpkg_arch }}"
45 {%- endfor %}
46           subarches:
47             - "generic"
48             - "ga-16.04"
49             - "hwe-16.04"
50           labels: '"*"'
51       fabrics:
52         pxe_admin:
53           name: 'pxe_admin'
54           description: Fabric for PXE/admin
55           vlans:
56             0:
57               name: 'vlan 0'
58               description: PXE/admin VLAN
59               dhcp: true
60               primary_rack: "${linux:network:hostname}"
61       subnets:
62         {{ nm.net_admin }}:
63           name: {{ nm.net_admin }}
64           cidr: {{ nm.net_admin }}
65           gateway_ip: ${_param:single_address}
66           fabric: ${maas:region:fabrics:pxe_admin:name}
67           vlan: 0
68           ipranges:
69             1:
70               start: {{ nm.net_admin_pool_start }}
71               end: {{ nm.net_admin_pool_end }}
72               type: dynamic
73       sshprefs:
74         - '{{ conf.MAAS_SSH_KEY }}'
75 {%- if 'aarch64' in nm.cluster.arch %}
76       package_repositories:
77         armband:
78           name: armband
79           enabled: '1'
80           url: 'http://linux.enea.com/mcp-repos/${_param:openstack_version}/${_param:linux_system_codename}'
81           distributions: '${_param:openstack_version}-armband'
82           components: 'main'
83           arches: 'arm64'
84           key: ${_param:armband_key}
85 {%- endif %}
86       salt_master_ip: ${_param:reclass_config_master}
87       domain: ${_param:cluster_domain}
88       ~maas_config:
89         maas_name: mas01
90         active_discovery_interval: 600
91         ntp_external_only: true
92         upstream_dns: ${_param:dns_server01}
93         commissioning_distro_series: 'xenial'
94         default_distro_series: 'xenial'
95         default_osystem: 'ubuntu'
96         default_storage_layout: 'lvm'
97         enable_http_proxy: true
98         disk_erase_with_secure_erase: false
99         dnssec_validation: 'no'
100         enable_third_party_drivers: true
101         network_discovery: 'enabled'
102         default_min_hwe_kernel: ${_param:hwe_kernel}
103     cluster:
104       saltstack_repo_xenial: "deb [arch=amd64] http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2017.7/ xenial main"
105   linux:
106     network:
107       interface:
108         mcpcontrol_interface:
109           enabled: true
110           name: ${_param:mcpcontrol_interface}
111           type: eth
112           proto: dhcp
113           mtu: ${_param:interface_mtu}
114         primary_interface:
115           enabled: true
116           name: ${_param:primary_interface}
117           type: eth
118 {%- if conf.idf.fuel.jumphost.get('trunks', {}).get('mgmt', False) and (nm.vlan_mgmt | int > 0) %}
119           proto: manual
120           mtu: ${_param:interface_mtu}
121         primary_interface_vlan:
122           enabled: true
123           type: vlan
124           name: ${_param:primary_interface}.{{ nm.vlan_mgmt }}
125           use_interfaces:
126             - ${_param:primary_interface}
127 {%- endif %}
128           proto: static
129           mtu: ${_param:interface_mtu}
130           address: ${_param:infra_maas_node01_address}
131           netmask: ${_param:opnfv_net_mgmt_mask}
132         pxe_admin_interface:
133           enabled: true
134           name: ${_param:pxe_admin_interface}
135           # MaaS has issues using MTU > 1500 for PXE interface
136           mtu: 1500
137           proto: static
138           address: ${_param:single_address}
139           netmask: ${_param:opnfv_net_admin_mask}
140           type: eth