This commit is contained in:
parent
51e2836378
commit
9758b23193
1
roles/Node/files/bridge.conf
Normal file
1
roles/Node/files/bridge.conf
Normal file
@ -0,0 +1 @@
|
||||
allow br0
|
@ -10,7 +10,8 @@
|
||||
package:
|
||||
name:
|
||||
- edk2-ovmf
|
||||
- qemu-headless
|
||||
- qemu-base
|
||||
- qemu-emulators-full
|
||||
- ddrescue
|
||||
state: present
|
||||
|
||||
@ -32,6 +33,7 @@
|
||||
|
||||
- name: QEMU Bridge Config
|
||||
become: yes
|
||||
register: qemubr
|
||||
copy:
|
||||
src: bridge.conf
|
||||
dest: /etc/qemu/bridge.conf
|
||||
@ -41,9 +43,10 @@
|
||||
|
||||
- name: System bridge interface
|
||||
become: yes
|
||||
when: qemubr.changed
|
||||
register: br0
|
||||
copy:
|
||||
src: br0
|
||||
template:
|
||||
src: netctl-bridge.j2
|
||||
dest: /etc/netctl/br0
|
||||
owner: root
|
||||
group: root
|
||||
@ -51,5 +54,10 @@
|
||||
|
||||
- name: Enable bridge
|
||||
become: yes
|
||||
when: br0.changed
|
||||
when: qemubr.changed or br0.changed
|
||||
command: "/bin/bash -l -c 'netctl enable br0 && netctl restart br0'"
|
||||
|
||||
- name: Remind about restarting VMs
|
||||
when: qemubr.changed or br0.changed
|
||||
debug:
|
||||
msg: You may need to restart VMs on the Node.
|
||||
|
5
roles/Node/templates/netctl-bridge.j2
Normal file
5
roles/Node/templates/netctl-bridge.j2
Normal file
@ -0,0 +1,5 @@
|
||||
Description="Bridged Network Interface for VMs"
|
||||
Interface=br0
|
||||
Connection=bridge
|
||||
BindsToInterfaces=({{ ipinterface }})
|
||||
IP=dhcp
|
Loading…
Reference in New Issue
Block a user