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