Move my home server over to linfi.
This commit is contained in:
7
ansible/roles/linfi/defaults/main.yaml
Normal file
7
ansible/roles/linfi/defaults/main.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
# linfi:
|
||||
# enabled: true
|
||||
# zfs_dataset: zroot/freebsd/current/vm/linfi
|
||||
# zfs_mountpoint: /vm/linfi
|
||||
# driver_blocklist: "if_iwm if_iwlwifi"
|
||||
# pci_blocklist: "1/0/0"
|
||||
# amd: true
|
||||
@@ -1,2 +0,0 @@
|
||||
devmatch_enable="YES"
|
||||
devmatch_blocklist="if_iwm if_iwlwifi"
|
||||
@@ -32,6 +32,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
: ${VNC_LISTEN:="127.0.0.1:5900"}
|
||||
: ${VNC_WIDTH:="1920"}
|
||||
: ${VNC_HEIGHT:="1080"}
|
||||
: ${PASSTHROUGH:="1/0/0"}
|
||||
|
||||
if [ "$VERBOSE" = "YES" ]; then
|
||||
set -x
|
||||
@@ -142,7 +143,7 @@ function start_vm {
|
||||
-s 0,hostbridge \
|
||||
-s "4,nvme,/dev/zvol/${zfs_path}/disk0" \
|
||||
-S \
|
||||
-s 7,passthru,1/0/0 \
|
||||
-s "7,passthru,${PASSTHROUGH}" \
|
||||
-s 30,xhci,tablet \
|
||||
-s 31,lpc -l com1,stdio \
|
||||
-l "bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd,${mount_path}/BHYVE_UEFI_VARS.fd" \
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
vmm_load="YES"
|
||||
pptdevs="1/0/0"
|
||||
hw.vmm.amdvi.enable="1"
|
||||
@@ -1,6 +1,6 @@
|
||||
- name: Install loader.conf
|
||||
copy:
|
||||
src: "files/{{ item }}_loader.conf"
|
||||
template:
|
||||
src: "templates/{{ item }}_loader.conf.j2"
|
||||
dest: "/boot/loader.conf.d/{{ item }}.conf"
|
||||
mode: 0644
|
||||
owner: root
|
||||
@@ -20,8 +20,8 @@
|
||||
dest: /usr/local/bin/launch_linfi
|
||||
|
||||
- name: Install rc script
|
||||
copy:
|
||||
src: "files/{{ item.src }}"
|
||||
template:
|
||||
src: "templates/{{ item.src }}.j2"
|
||||
dest: "/usr/local/etc/rc.d/{{ item.dest|default(item.src) }}"
|
||||
owner: root
|
||||
group: wheel
|
||||
@@ -38,4 +38,13 @@
|
||||
group: wheel
|
||||
loop:
|
||||
- linfi
|
||||
|
||||
- name: Install service configuration
|
||||
template:
|
||||
src: "templates/{{ item }}_rc.conf.j2"
|
||||
dest: "/etc/rc.conf.d/{{ item }}"
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: wheel
|
||||
loop:
|
||||
- devmatch
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
# when: foo is defined
|
||||
when: linfi is defined and linfi.enabled
|
||||
|
||||
2
ansible/roles/linfi/templates/devmatch_rc.conf.j2
Normal file
2
ansible/roles/linfi/templates/devmatch_rc.conf.j2
Normal file
@@ -0,0 +1,2 @@
|
||||
devmatch_enable="YES"
|
||||
devmatch_blocklist="{{ linfi.driver_blocklist }}"
|
||||
@@ -14,7 +14,7 @@ load_rc_config $name
|
||||
tmux_name="linfi"
|
||||
|
||||
linfi_start() {
|
||||
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=YES VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /usr/local/bin/launch_linfi start linfi zroot/freebsd/current/vm/linfi /vm/linfi"
|
||||
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env PASSTHROUGH='{{ linfi.pci_blocklist }}' /usr/local/bin/bash /usr/local/bin/launch_linfi start linfi {{ linfi.zfs_dataset }} {{ linfi.zfs_mountpoint }}"
|
||||
# /vm/.iso/alpine-extended-3.20.3-x86_64.iso
|
||||
}
|
||||
|
||||
5
ansible/roles/linfi/templates/linfi_loader.conf.j2
Normal file
5
ansible/roles/linfi/templates/linfi_loader.conf.j2
Normal file
@@ -0,0 +1,5 @@
|
||||
vmm_load="YES"
|
||||
pptdevs="{{ linfi.pci_blocklist }}"
|
||||
{% if linfi.amd %}
|
||||
hw.vmm.amdvi.enable="1"
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user