[noha] Parameterize network configuration
[fuel.git] / mcp / reclass / classes / cluster / mcp-common-noha / openstack_gateway_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 ---
9 {%- import 'net_map.j2' as nm with context %}
10 {%- import 'net_macros.j2' as ma with context %}
11 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
12 {%- set nics = { nm.ctl01.nic_mgmt: True, nm.ctl01.nic_private: True } %}
13 {%- set vlan_private_start = (nm.vlan_private | string).rsplit('-')[0] %}
14 {%- set vlans = { nm.vlan_mgmt: nm.ctl01.nic_mgmt, vlan_private_start: nm.ctl01.nic_private } %}
15 parameters:
16   linux:
17     network:
18       bridge: openvswitch
19       interface:
20         pxe_admin_int:
21           enabled: true
22           name: {{ nm.ctl01.nic_admin }}
23           proto: static
24           type: eth
25           address: ${_param:pxe_admin_address}
26           netmask: ${_param:opnfv_net_admin_mask}
27           mtu: ${_param:interface_mtu}
28           noifupdown: true
29
30 {#- prevent duplicates for tagged mgmt on the same physical interface as PXE/admin #}
31 {%- if nm.ctl01.nic_admin in nics %}
32   {%- do nics.pop(nm.ctl01.nic_admin) %}
33 {%- endif %}
34
35 {{ ma.linux_network_interfaces_nic(nics) }}
36
37 {{ ma.linux_network_interfaces_vlan(vlans) }}
38
39         ovs_port_{{ nm.ctl01.nic_public }}:
40           enabled: true
41           name: {{ ma.interface_str(nm.ctl01.nic_public, nm.vlan_public) }}
42           proto: manual
43           ovs_port_type: OVSPort
44           type: ovs_port
45           ovs_bridge: br-floating
46           bridge: br-floating
47         br-floating:
48           enabled: true
49           type: ovs_bridge
50           mtu: ${_param:interface_mtu}
51           proto: static
52           address: ${_param:external_address}
53           netmask: ${_param:opnfv_net_public_mask}
54           use_interfaces:
55             - {{ ma.interface_str(nm.ctl01.nic_public, nm.vlan_public) }}
56           gateway: ${_param:opnfv_net_public_gw}
57           name_servers: {{ nm.dns_public }}
58         br-mgmt:
59           enabled: true
60           type: bridge
61           proto: static
62           address: ${_param:single_address}
63           netmask: ${_param:opnfv_net_mgmt_mask}
64           mtu: ${_param:interface_mtu}
65           use_interfaces:
66             - {{ ma.interface_str(nm.ctl01.nic_mgmt, nm.vlan_mgmt) }}