Skip to content

Commit

Permalink
[travis skip] rebase with oss upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
Tcharl committed Nov 10, 2021
1 parent e30f1ce commit 6b13160
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ should be a dict containing the following items:
- `name` The name of the network.
- `mode` The forwarding mode of the network, `bridge`, `route` and `nat` are
supported.

- `bridge` The name of the bridge interface for this network.
- `zone` the firewalld zone for the bridge (defaults to public)
- `ip` IP address of the virtual bridge, mandatory for `route` and `nat` mode.
Expand All @@ -46,6 +45,18 @@ should be a dict containing the following items:
name (optional).
- `dhcp_start` First IP of the DHCP range in `route` or `nat` mode (optional).
- `dhcp_end` Last IP of the DHCP range in `route` or `nat` mode (optional).
- `routes` Optional list of additionals routes defined as following:
- `address` Address of the route, required.
- `prefix` Prefix of the route, required.
- `gateway` Gateway of the route, required.
- `metric` Metric of the route (optional).
- `ipv6` IPv6 address of the virtual bridge (optional).
- `ipv6_prefix` IPv6 prefix of the virtual bridge (optional).
- `routesv6` Optional list of additionals IPv6 routes defined as following:
- `address` IPv6 address of the route, required.
- `prefix` IPv6 previx of the route, required.
- `gateway` gateway of the route, required.
- `metric` metric of the route (optional).

`libvirt_host_require_vt` is whether to require that Intel Virtualisation
Technology (VT) is enabled in order to run this role. While this provides
Expand Down
26 changes: 20 additions & 6 deletions templates/network.xml.j2
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
<network connections='1'>
<network {% if item.ipv6 is defined %}ipv6='yes'{% endif %} connections='1'>
<name>{{ item.name }}</name>
<forward mode='{{ item.mode }}'/>
<bridge name='{{ item.bridge }}'/>
{% if item.mode == 'route' or item.mode == 'nat' %}
<bridge name='{{ item.bridge }}'{% if item.zone is defined %} zone='{{ item.zone }}'{% endif %}/>
{% if item.mode == 'route' or item.mode == 'nat' %}
<domain name='{{ item.domain|default(item.name) }}'/>
<ip address='{{ item.ip }}' netmask='{{ item.netmask }}'>
{% if item.dhcp_start is defined and item.dhcp_end is defined %}
<dhcp>
<range start='{{ item.dhcp_start }}' end='{{ item.dhcp_end }}'/>
</dhcp>
<dhcp>
<range start='{{ item.dhcp_start }}' end='{{ item.dhcp_end }}'/>
</dhcp>
{% endif %}
</ip>
{% if item.routes is defined %}
{% for route in item.routes %}
<route address="{{ route.address }}" prefix="{{ route.prefix }}" gateway="{{ route.gateway }}" {% if route.metric is defined %} metric='{{ route.metric }}' {% endif %}/>
{% endfor %}
{% endif %}
{% if item.ipv6 is defined and item.ipv6_prefix is defined %}
<ip family='ipv6' address='{{ item.ipv6 }}' prefix='{{ item.ipv6_prefix }}'>
</ip>
{% endif %}
{% if item.routesv6 is defined %}
{% for route in item.routesv6 %}
<route family="ipv6" address="{{ route.address }}" prefix="{{ route.prefix }}" gateway="{{ route.gateway }}" {% if route.metric is defined %} metric='{{ route.metric }}' {% endif %}/>
{% endfor %}
{% endif %}
{% endif %}
</network>

0 comments on commit 6b13160

Please sign in to comment.