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:
|
package:
|
||||||
name:
|
name:
|
||||||
- edk2-ovmf
|
- edk2-ovmf
|
||||||
- qemu-headless
|
- qemu-base
|
||||||
|
- qemu-emulators-full
|
||||||
- ddrescue
|
- ddrescue
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
@ -32,6 +33,7 @@
|
|||||||
|
|
||||||
- name: QEMU Bridge Config
|
- name: QEMU Bridge Config
|
||||||
become: yes
|
become: yes
|
||||||
|
register: qemubr
|
||||||
copy:
|
copy:
|
||||||
src: bridge.conf
|
src: bridge.conf
|
||||||
dest: /etc/qemu/bridge.conf
|
dest: /etc/qemu/bridge.conf
|
||||||
@ -41,9 +43,10 @@
|
|||||||
|
|
||||||
- name: System bridge interface
|
- name: System bridge interface
|
||||||
become: yes
|
become: yes
|
||||||
|
when: qemubr.changed
|
||||||
register: br0
|
register: br0
|
||||||
copy:
|
template:
|
||||||
src: br0
|
src: netctl-bridge.j2
|
||||||
dest: /etc/netctl/br0
|
dest: /etc/netctl/br0
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
@ -51,5 +54,10 @@
|
|||||||
|
|
||||||
- name: Enable bridge
|
- name: Enable bridge
|
||||||
become: yes
|
become: yes
|
||||||
when: br0.changed
|
when: qemubr.changed or br0.changed
|
||||||
command: "/bin/bash -l -c 'netctl enable br0 && netctl restart br0'"
|
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