Skip to content

Commit

Permalink
Add possibility to bridge interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianrakel committed Sep 24, 2024
1 parent 9589cc6 commit e909673
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions templates/domain/device_interface.epp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<%- | Libvirt::Domain::Interface $iface,
String $boot,
| -%>
<%- if $iface['bridge_network'] and $iface['bridge_network'] == true { -%>
<interface type='bridge'>
<%- } else { -%>
<interface type='network'>
<%- } -%>
<%- if 'mac' in $iface { -%>
<mac address='<%= $iface['mac'] %>'/>
<%- } -%>
Expand All @@ -22,7 +26,11 @@
</filterref>
<%- } -%>
<%- } -%>
<%- if $iface['bridge_network'] and $iface['bridge_network'] == true { -%>
<source bridge='<%= $iface['network'] %>'/>
<%- } else { -%>
<source network='<%= $iface['network'] %>'<% if 'portgroup' in $iface { %> portgroup='<%= $iface['portgroup'] %>'<% } %>/>
<%- } -%>
<model type='<% if 'type' in $iface { %><%= $iface['type'] %><% }else{ %>virtio<% } %>'/>
<%- if $boot == 'per-device' and 'boot_order' in $iface { -%>
<boot order='<%= $iface['boot_order'] %>'/>
Expand Down
3 changes: 2 additions & 1 deletion types/domain/interface.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
]],
}],
]],
boot_order => Optional[Integer],
boot_order => Optional[Integer],
bridge_network => Optional[Boolean],
}]

0 comments on commit e909673

Please sign in to comment.