[baremetal] Update openstack version to pike
[fuel.git] / mcp / reclass / classes / cluster / baremetal-mcp-pike-common-ha / openstack_compute_pdf.yml.j2
1 ##############################################################################
2 # Copyright (c) 2017 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 {%- if conf.net_config is defined and conf.idf is defined -%}
10     {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
11
12     {#- Determine interface index for each network (plumbing vars) -#}
13     {%- set idx_admin = conf['net_config']['admin']['interface'] -%}
14     {%- set idx_mgmt = conf['net_config']['mgmt']['interface'] -%}
15     {%- set idx_private = conf['net_config']['private']['interface'] -%}
16     {%- set idx_public = conf['net_config']['public']['interface'] -%}
17
18     {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
19     {%- set iface_names = conf['idf']['fuel']['network']['node'][0]['interfaces'] -%}
20     {%- set nic_admin = iface_names[idx_admin] -%}
21     {%- set nic_mgmt = iface_names[idx_mgmt] -%}
22     {%- set nic_private = iface_names[idx_private] -%}
23     {%- set nic_public = iface_names[idx_public] -%}
24
25     {#- VLAN for each network (only untagged 'admin' is supported by MaaS config!) -#}
26     {%- set vlan_admin = conf['net_config']['admin']['vlan'] -%}
27     {%- set vlan_mgmt = conf['net_config']['mgmt']['vlan'] -%}
28     {%- set vlan_private = conf['net_config']['private']['vlan'] -%}
29     {%- set vlan_public = conf['net_config']['public']['vlan'] -%}
30
31     {%- set gateway_public = conf['net_config']['public']['gateway'] -%}
32 {%- else -%}
33     {%- set nic_admin = 'enp6s0' -%}
34     {%- set nic_mgmt = 'enp6s0' -%}
35     {%- set nic_private = None -%}
36     {%- set nic_public = None -%}
37     {%- set vlan_admin = 'native' -%}
38     {%- set vlan_mgmt = '300' -%}
39     {%- set vlan_private = '1000' -%}
40 {%- endif -%}
41
42 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) -#}
43 {%- set nics = { nic_admin: True, nic_mgmt: True, nic_public: True} -%}
44
45 {%- set vlans = { vlan_admin: nic_admin, vlan_mgmt: nic_mgmt, vlan_public: nic_public} -%}
46 ---
47 parameters:
48   linux:
49     network:
50       bridge: openvswitch
51       interface:
52 {%- for nic in nics %}
53     {%- if nic == nic_admin %}
54         {{ nic }}:
55           enabled: true
56           type: eth
57           proto: dhcp
58           name: {{ nic }}
59     {%- else %}
60         {{ nic }}:
61           enabled: true
62           type: eth
63           proto: manual
64           address: 0.0.0.0
65           netmask: 255.255.255.0
66           mtu: ${_param:interface_mtu}
67           name: {{ nic }}
68     {%- endif %}
69 {%- endfor %}
70
71 {%- for vlan in vlans %}
72     {%- if vlan and vlan != 'native' %}
73         {{ vlans[vlan] }}.{{ vlan }}:
74           enabled: true
75           proto: manual
76           type: vlan
77           name: {{ vlans[vlan] }}.{{ vlan }}
78           use_interfaces:
79             - {{ vlans[vlan] }}
80     {%- endif %}
81 {%- endfor %}
82
83         br-ctl:
84           enabled: true
85           type: bridge
86           proto: static
87           address: ${_param:single_address}
88           netmask: 255.255.255.0
89           use_interfaces:
90             - {{ nic_mgmt }}{% if vlan_mgmt and vlan_mgmt != 'native' %}.{{ vlan_mgmt }}{% endif %}
91         br-floating:
92           enabled: true
93           type: ovs_bridge
94           mtu: ${_param:interface_mtu}
95         br-ex:
96           enabled: true
97           type: ovs_bridge
98           mtu: ${_param:interface_mtu}
99           address: ${_param:external_address}
100           netmask: 255.255.255.0
101           proto: static
102           gateway: {{ gateway_public }}
103         floating-to-ex:
104           enabled: true
105           type: ovs_port
106           port_type: patch
107           bridge: br-floating
108           peer: ex-to-floating
109         ex-to-floating:
110           enabled: true
111           type: ovs_port
112           port_type: patch
113           bridge: br-ex
114           peer: floating-to-ex
115         public_ovs_interface:
116           enabled: true
117           name: {{ nic_public }}{% if vlan_public and vlan_public != 'native' %}.{{ vlan_public }}{% endif %}
118           proto: manual
119           ovs_port_type: OVSPort
120           type: ovs_port
121           ovs_bridge: br-ex
122           bridge: br-ex