Skip to content

Commit 6b13160

Browse files
committed
[travis skip] rebase with oss upstream
1 parent e30f1ce commit 6b13160

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ should be a dict containing the following items:
3737
- `name` The name of the network.
3838
- `mode` The forwarding mode of the network, `bridge`, `route` and `nat` are
3939
supported.
40-
4140
- `bridge` The name of the bridge interface for this network.
4241
- `zone` the firewalld zone for the bridge (defaults to public)
4342
- `ip` IP address of the virtual bridge, mandatory for `route` and `nat` mode.
@@ -46,6 +45,18 @@ should be a dict containing the following items:
4645
name (optional).
4746
- `dhcp_start` First IP of the DHCP range in `route` or `nat` mode (optional).
4847
- `dhcp_end` Last IP of the DHCP range in `route` or `nat` mode (optional).
48+
- `routes` Optional list of additionals routes defined as following:
49+
- `address` Address of the route, required.
50+
- `prefix` Prefix of the route, required.
51+
- `gateway` Gateway of the route, required.
52+
- `metric` Metric of the route (optional).
53+
- `ipv6` IPv6 address of the virtual bridge (optional).
54+
- `ipv6_prefix` IPv6 prefix of the virtual bridge (optional).
55+
- `routesv6` Optional list of additionals IPv6 routes defined as following:
56+
- `address` IPv6 address of the route, required.
57+
- `prefix` IPv6 previx of the route, required.
58+
- `gateway` gateway of the route, required.
59+
- `metric` metric of the route (optional).
4960

5061
`libvirt_host_require_vt` is whether to require that Intel Virtualisation
5162
Technology (VT) is enabled in order to run this role. While this provides

templates/network.xml.j2

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
1-
<network connections='1'>
1+
<network {% if item.ipv6 is defined %}ipv6='yes'{% endif %} connections='1'>
22
<name>{{ item.name }}</name>
33
<forward mode='{{ item.mode }}'/>
4-
<bridge name='{{ item.bridge }}'/>
5-
{% if item.mode == 'route' or item.mode == 'nat' %}
4+
<bridge name='{{ item.bridge }}'{% if item.zone is defined %} zone='{{ item.zone }}'{% endif %}/>
5+
{% if item.mode == 'route' or item.mode == 'nat' %}
66
<domain name='{{ item.domain|default(item.name) }}'/>
77
<ip address='{{ item.ip }}' netmask='{{ item.netmask }}'>
88
{% if item.dhcp_start is defined and item.dhcp_end is defined %}
9-
<dhcp>
10-
<range start='{{ item.dhcp_start }}' end='{{ item.dhcp_end }}'/>
11-
</dhcp>
9+
<dhcp>
10+
<range start='{{ item.dhcp_start }}' end='{{ item.dhcp_end }}'/>
11+
</dhcp>
1212
{% endif %}
1313
</ip>
14+
{% if item.routes is defined %}
15+
{% for route in item.routes %}
16+
<route address="{{ route.address }}" prefix="{{ route.prefix }}" gateway="{{ route.gateway }}" {% if route.metric is defined %} metric='{{ route.metric }}' {% endif %}/>
17+
{% endfor %}
1418
{% endif %}
19+
{% if item.ipv6 is defined and item.ipv6_prefix is defined %}
20+
<ip family='ipv6' address='{{ item.ipv6 }}' prefix='{{ item.ipv6_prefix }}'>
21+
</ip>
22+
{% endif %}
23+
{% if item.routesv6 is defined %}
24+
{% for route in item.routesv6 %}
25+
<route family="ipv6" address="{{ route.address }}" prefix="{{ route.prefix }}" gateway="{{ route.gateway }}" {% if route.metric is defined %} metric='{{ route.metric }}' {% endif %}/>
26+
{% endfor %}
27+
{% endif %}
28+
{% endif %}
1529
</network>

0 commit comments

Comments
 (0)