File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,17 @@ should be a dict containing the following items:
26
26
` libvirt_host_networks ` is a list of networks to define and start. Each item
27
27
should be a dict containing the following items:
28
28
- ` name ` The name of the network.
29
- - ` mode ` The forwarding mode of the network, currently only ` bridge ` is
29
+ - ` mode ` The forwarding mode of the network, ` bridge ` , ` route ` and ` nat ` are
30
30
supported.
31
31
- ` bridge ` The name of the bridge interface for this network.
32
-
33
- ` libvirt_host_require_vt ` is whether to require that Intel Virtualisation
32
+ - ` ip ` IP address of the virtual bridge, mandatory for ` route ` and ` nat ` mode.
33
+ - ` netmask ` Netmask of the virtual bridge, mandatory for ` route ` and ` nat ` mode.
34
+ - ` domain ` DNS domain name for ` route ` and ` nat ` mode, default to the network
35
+ name (optional).
36
+ - ` dhcp_start ` First IP of the DHCP range in ` route ` or ` nat ` mode (optional).
37
+ - ` dhcp_end ` Last IP of the DHCP range in ` route ` or ` nat ` mode (optional).
38
+
39
+ ` libvirt_host_require_vt ` is whether to require that Intel Virtualisation
34
40
Technology (VT) is enabled in order to run this role. While this provides
35
41
better VM performance, it may not be available in certain environments. The
36
42
default value is ` true ` .
@@ -91,6 +97,14 @@ Example Playbook
91
97
- name: br-example
92
98
mode: bridge
93
99
bridge: br-example
100
+ - name: brnat-example
101
+ mode: nat
102
+ bridge: brnat-example
103
+ domain: example.local
104
+ ip: 192.168.133.254
105
+ netmask: 255.255.255.0
106
+ dhcp_start: 192.168.133.100
107
+ dhcp_end: 192.168.133.200
94
108
95
109
Author Information
96
110
------------------
Original file line number Diff line number Diff line change 2
2
<name >{{ item.name }}</name >
3
3
<forward mode =' {{ item.mode }}' />
4
4
<bridge name =' {{ item.bridge }}' />
5
+ {% if item .mode == 'route' or item .mode == 'nat' %}
6
+ <domain name =' {{ item.domain|default(item.name) }}' />
7
+ <ip address =' {{ item.ip }}' netmask =' {{ item.netmask }}' >
8
+ {% 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 >
12
+ {% endif %}
13
+ </ip >
14
+ {% endif %}
5
15
</network >
You can’t perform that action at this time.
0 commit comments