Configure bhyve.
This commit is contained in:
parent
fbfadadffc
commit
a344c92d83
@ -45,3 +45,4 @@ jail_list:
|
||||
conf:
|
||||
src: dagger
|
||||
bhyve_dataset: zroot/freebsd/release/vm
|
||||
bhyve_list: []
|
||||
|
@ -1 +1,2 @@
|
||||
bhyve_mountpoint: "/vm"
|
||||
bhyve_list: []
|
||||
|
17
ansible/roles/bhyve/files/arch.conf
Normal file
17
ansible/roles/bhyve/files/arch.conf
Normal file
@ -0,0 +1,17 @@
|
||||
# Use UEFI when booting from a disk
|
||||
loader="uefi"
|
||||
graphics="yes"
|
||||
xhci_mouse="yes"
|
||||
graphics_listen="127.0.0.1"
|
||||
#graphics_listen="10.216.1.1"
|
||||
graphics_res="1920x1080"
|
||||
#prestart=""
|
||||
|
||||
cpu=1
|
||||
memory=1024M
|
||||
network0_type="virtio-net"
|
||||
network0_switch="customswitch"
|
||||
disk0_type="virtio-blk"
|
||||
disk0_name="disk0"
|
||||
disk0_dev="sparse-zvol"
|
||||
virt_random="yes" # virtio-rnd
|
@ -20,3 +20,34 @@
|
||||
state: present
|
||||
extra_zfs_properties:
|
||||
mountpoint: "{{ bhyve_mountpoint }}"
|
||||
|
||||
- name: Enable bhyve
|
||||
community.general.sysrc:
|
||||
name: "{{ item.name }}"
|
||||
value: "{{ item.value }}"
|
||||
path: /etc/rc.conf.d/vm
|
||||
loop:
|
||||
- name: vm_enable
|
||||
value: "YES"
|
||||
- name: vm_dir
|
||||
value: "zfs:{{ bhyve_dataset }}"
|
||||
- name: vm_list
|
||||
value: "{{ bhyve_list|community.general.json_query('[?enabled==`true`].name')|join(' ') }}"
|
||||
- name: vm_delay
|
||||
value: "5"
|
||||
|
||||
- name: init vm-bhyve
|
||||
command: vm init
|
||||
args:
|
||||
creates: "{{ bhyve_mountpoint }}/.templates"
|
||||
|
||||
- name: Install Configuration
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: wheel
|
||||
loop:
|
||||
- src: arch.conf
|
||||
dest: "{{ bhyve_mountpoint }}/.templates/arch.conf"
|
||||
|
Loading…
Reference in New Issue
Block a user