Skip to content

Commit

Permalink
[feature] add option for creating lib-virt network with a single vlan…
Browse files Browse the repository at this point in the history
… tag.

Update jinja template to allow creation of a lib-virt network that when 
used by a kvm guest would add the guests vnic as an access port in a 
specific vlan in openvswitch. Some lib-virt integrations such as MAAS do 
not support adding a vnic to a specific 'portgroup'.

fixes mrlesmithjr#18
  • Loading branch information
2stacks committed Aug 29, 2018
1 parent 6ed93e3 commit 4971425
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,13 @@ kvm_virtual_networks: []
# bridge_name: 'vmbr101'
# autostart: true
# state: active
# - name: 'maas'
# mode: 'bridge'
# bridge_name: 'ovsbr0'
# autostart: true
# state: active
# virtualport_type: 'openvswitch'
# vlan: 193

# Define VM(s) to create
kvm_vms: []
Expand Down
7 changes: 7 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ kvm_virtual_networks: []
# bridge_name: 'vmbr101'
# autostart: true
# state: active
# - name: 'maas'
# mode: 'bridge'
# bridge_name: 'ovsbr0'
# autostart: true
# state: active
# virtualport_type: 'openvswitch'
# vlan: 193

# Define VM(s) to create
kvm_vms: []
Expand Down
5 changes: 5 additions & 0 deletions templates/vm-network.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@
</portgroup>
{% endfor %}
{% endif %}
{% if item['vlan'] is defined %}
<vlan>
<tag id="{{ item['vlan'] }}" />
</vlan>
{% endif %}
</network>

0 comments on commit 4971425

Please sign in to comment.