From b6926273175daf9cbdfbe30a43c0f2aa9670c7c0 Mon Sep 17 00:00:00 2001 From: Alexandre Pires Date: Sat, 31 May 2025 00:28:04 +0200 Subject: [PATCH] Add configuration and playbook for virtualization host setup - Create host variable file for vh-01.alexpires.dev with user, SSH, firewall, and VM configurations. - Update playbook_duo_security.yml to target the 2fa group. - Introduce playbook_virt_host.yml for setting up GPU passthrough on Fedora with QEMU/KVM. - Add required collections to requirements.yml for Podman and Libvirt. - Modify ctrlaltdel.yml to remove existing symlink for ctrl-alt-del.target before masking it. - Enhance users.yml to show warnings for users that could not be removed. - Update Duo Security role to use the correct repository and package names. - Improve login role to handle user UID and group assignments. - Create udev rules template for NVMe devices. - Add blacklist template for VFIO drivers. - Implement domain XML template for virtual machines with detailed configurations. - Update inventory to include vh-01.alexpires.dev in relevant groups. - Refactor cpu_power_monitor.py for improved error handling and modularity. --- ansible/files/vms/fedora-headless.xml | 199 ------------ ansible/files/vms/old/fedora-headless.old.xml | 220 ------------- ansible/files/vms/old/windows-11-pro.old.xml | 300 ------------------ ansible/files/vms/windows-11.xml | 224 ------------- ansible/host_vars/vh-01.alexpires.dev.yml | 189 +++++++++++ ansible/playbook_duo_security.yml | 2 +- ...ook_vm_host.yml => playbook_virt_host.yml} | 144 +++++---- ansible/requirements.yml | 2 + ansible/roles/cis/tasks/ctrlaltdel.yml | 15 +- ansible/roles/cis/tasks/users.yml | 16 +- ansible/roles/duo/tasks/main.yml | 6 +- ansible/roles/login/tasks/main.yml | 7 +- ansible/templates/99-qemu-nvme.rules.j2 | 3 + ansible/templates/blacklist.conf.j2 | 3 + ansible/templates/domain.xml.j2 | 255 +++++++++++++++ inventory/hosts | 10 + scripts/cpu_power_monitor.py | 39 ++- 17 files changed, 594 insertions(+), 1040 deletions(-) delete mode 100644 ansible/files/vms/fedora-headless.xml delete mode 100644 ansible/files/vms/old/fedora-headless.old.xml delete mode 100644 ansible/files/vms/old/windows-11-pro.old.xml delete mode 100644 ansible/files/vms/windows-11.xml create mode 100644 ansible/host_vars/vh-01.alexpires.dev.yml rename ansible/{localhost_playbook_vm_host.yml => playbook_virt_host.yml} (60%) create mode 100644 ansible/templates/99-qemu-nvme.rules.j2 create mode 100644 ansible/templates/blacklist.conf.j2 create mode 100644 ansible/templates/domain.xml.j2 diff --git a/ansible/files/vms/fedora-headless.xml b/ansible/files/vms/fedora-headless.xml deleted file mode 100644 index c6449ac..0000000 --- a/ansible/files/vms/fedora-headless.xml +++ /dev/null @@ -1,199 +0,0 @@ - - fedora-headless - 55feda16-51ae-446e-9c83-4c0eee1e5e00 - Fedora CUDA headless - 33554432 - 33554432 - - - - - - 2 - - - - - - - hvm - /usr/share/edk2/ovmf/OVMF_CODE.fd - /var/lib/libvirt/qemu/nvram/fedora-headless_VARS.fd - - - - - - - - - - - - - - - - - - destroy - restart - destroy - - - - - - /usr/bin/qemu-system-x86_64 - - - - - - - - - -
- - - - - - - -
- - -
- - - - - -
- - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - - - -
- - -
- - -
- - - - - -
- - - - - -
- - - - - - - - - - - - - - -