Skip to content

Commit ab1a079

Browse files
authored
Merge pull request #69 from gprocunier/interface-aliases
Interface aliases
2 parents 78e50e4 + a147afb commit ab1a079

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ Role Variables
143143
interfaces. Default is `libvirt_vm_trust_guest_rx_filters`.
144144
- `model`: The name of the interface model. Eg. `e1000` or `ne2k_pci`, if undefined
145145
it defaults to `virtio`.
146+
- `alias`: An optional interface alias. This can be used to tie specific network
147+
configuration to persistent network devices via name. The user defined alias is
148+
always prefixed with `ua-` to be compliant (aliases without `ua-` are ignored by libvirt.
149+
If undefined it defaults to libvirt managed `vnetX`.
146150
- `console_log_enabled`: if `true`, log console output to a file at the
147151
path specified by `console_log_path`, **instead of** to a PTY. If
148152
`false`, direct terminal output to a PTY at serial port 0. Default is

templates/vm.xml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@
8484
{% else %}
8585
<model type='virtio'/>
8686
{% endif %}
87+
{% if interface.alias is defined %}
88+
<alias name='ua-{{ interface.alias }}'/>
89+
{% endif %}
8790
</interface>
8891
{% endfor %}
8992
{% if console_log_enabled | bool %}

0 commit comments

Comments
 (0)