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