reclass: maas: Dynamic machine definitions
[fuel.git] / mcp / reclass / classes / cluster / mcp-pike-common-ha / openstack_compute_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 {#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
9 {%- import 'net_map.j2' as nm with context %}
10 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
11 {%- set nics = { nm.cmp001.nic_admin: True, nm.cmp001.nic_mgmt: True } %}
12 {%- set vlans = { nm.vlan_admin: nm.cmp001.nic_admin, nm.vlan_mgmt: nm.cmp001.nic_mgmt } %}
13 ---
14 parameters:
15   linux:
16     network:
17       bridge: openvswitch
18       interface:
19 {%- for nic in nics %}
20     {%- if nic == nm.cmp001.nic_admin %}
21         {{ nic }}:
22           enabled: true
23           type: eth
24           proto: dhcp
25           name: {{ nic }}
26     {%- else %}
27         {{ nic }}:
28           enabled: true
29           type: eth
30           proto: manual
31           address: 0.0.0.0
32           {%- if nic == nm.cmp001.nic_public %}
33           netmask: ${_param:opnfv_net_public_mask}
34           {%- else %}
35           netmask: 255.255.255.0
36           {%- endif %}
37           mtu: ${_param:interface_mtu}
38           name: {{ nic }}
39     {%- endif %}
40 {%- endfor %}
41
42 {%- for vlan in vlans %}
43     {%- if vlan and vlan != 'native' %}
44         {{ vlans[vlan] }}.{{ vlan }}:
45           enabled: true
46           proto: manual
47           type: vlan
48           name: {{ vlans[vlan] }}.{{ vlan }}
49           use_interfaces:
50             - {{ vlans[vlan] }}
51     {%- endif %}
52 {%- endfor %}
53
54         br-ctl:
55           enabled: true
56           type: bridge
57           proto: static
58           address: ${_param:single_address}
59           netmask: 255.255.255.0
60           use_interfaces:
61             - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
62         br-floating:
63           enabled: true
64           type: ovs_bridge
65           mtu: ${_param:interface_mtu}
66         br-ex:
67           enabled: true
68           type: ovs_port
69           bridge: br-floating
70           proto: static
71           {%- if nm.vlan_public and nm.vlan_public != 'native' %}
72           ovs_options: tag={{ nm.vlan_public }}
73           {%- endif %}
74           address: ${_param:external_address}
75           netmask: 255.255.255.0
76           route:
77             public:
78               address: 0.0.0.0
79               netmask: 0.0.0.0
80               gateway: ${_param:opnfv_net_public_gw}
81         {{ nm.cmp001.nic_public }}:
82           enabled: true
83           proto: manual
84           ovs_port_type: OVSPort
85           type: ovs_port
86           ovs_bridge: br-floating
87           bridge: br-floating