[ovs/dpdk] Parameterize node-specific compute args
[fuel.git] / mcp / scripts / virsh_net / net_public.xml.j2
1 <!--
2  Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3
4  All rights reserved. This program and the accompanying materials
5  are made available under the terms of the Apache License, Version 2.0
6  which accompanies this distribution, and is available at
7  http://www.apache.org/licenses/LICENSE-2.0
8 -->
9 {%- set cluster = {'has_virtual_nodes': False} %}
10 {%- for node in conf.nodes %}
11   {%- if not cluster.has_virtual_nodes and node.node.type == 'virtual' %}
12     {%- set _ = cluster.update({'has_virtual_nodes': True}) %}
13   {%- endif %}
14 {%- endfor %}
15 {%- if conf.idf.net_config.public is defined %}
16   {%- set public_network = conf.idf.net_config.public.network %}
17   {%- set public_prefix = conf.idf.net_config.public.mask %}
18 {%- else %}
19   {%- set public_network = '10.16.0.0' %}
20   {%- set public_prefix = '24' %}
21 {%- endif %}
22 <network>
23   <name>public</name>
24   <bridge name="public"/>
25 {%- if cluster.has_virtual_nodes %}
26 {#- Ideally, jumpserver would have a real Linux bridge we will hook to.
27     In case it doesn't, we use this virsh network as a *mock* public.
28     The *mock* public should NOT overlap with the real public in any way. #}
29   <forward mode="nat"/>
30   <ip address="{{ public_network | ipaddr_index(1) }}" netmask="{{ public_prefix | netmask }}"/>
31 {%- endif %}
32 </network>