[j2 parsing] Adopt new generate_config features
[fuel.git] / mcp / reclass / classes / cluster / mcp-pike-odl-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 {%- import 'net_map.j2' as nm with context %}
9 {#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
10 {%- set nics = { nm.cmp001.nic_private: True } %}
11 {%- set vlans = { nm.vlan_private: nm.cmp001.nic_private } %}
12 ---
13 parameters:
14   linux:
15     network:
16       interface:
17 {%- for nic in nics %}
18         {{ nic }}:
19           enabled: true
20           type: eth
21     {%- if nic == nm.cmp001.nic_admin %}
22           proto: dhcp
23     {%- else %}
24           proto: manual
25     {%- endif %}
26           name: {{ nic }}
27 {%- endfor %}
28
29 {%- for vlan in vlans %}
30     {%- if vlan | int > 0 %}
31         {{ vlans[vlan] }}.{{ vlan }}:
32           enabled: true
33           proto: manual
34           type: vlan
35           name: {{ vlans[vlan] }}.{{ vlan }}
36           use_interfaces:
37             - {{ vlans[vlan] }}
38     {%- endif %}
39 {%- endfor %}
40
41         br-mesh:
42           enabled: true
43           type: bridge
44           address: ${_param:tenant_address}
45           netmask: 255.255.255.0
46           mtu: 1500
47           use_interfaces:
48             - {{ nm.cmp001.nic_private }}{% if nm.vlan_private | int > 0 %}.{{ nm.vlan_private }}{% endif %}