Initial commit

This commit is contained in:
2026-06-08 21:32:55 +02:00
commit 498018d3d7
11 changed files with 330 additions and 0 deletions
@@ -0,0 +1,61 @@
---
- name: Install KVM and virtualization tools
package:
name:
- qemu-kvm
- libvirt-daemon-system
- libvirt-clients
- bridge-utils
- virtinst
- virt-manager
- libguestfs-tools
- xz-utils
state: present
when: ansible_facts['os_family'] == "Debian"
- name: Install KVM and virtualization tools (RedHat/Fedora)
package:
name:
- qemu-kvm
- libvirt
- virt-install
- virt-manager
- libguestfs-tools
- xz
state: present
when: ansible_facts['os_family'] == "RedHat"
- name: Install KVM and virtualization tools (Arch/CachyOS)
package:
name:
- qemu-full
- libvirt
- virt-manager
- iproute2
- libguestfs
- guestfs-tools
- xz
state: present
when: ansible_facts['os_family'] == "Archlinux"
- name: Ensure libvirtd is started and enabled
service:
name: libvirtd
state: started
enabled: yes
- name: Ensure KVM default network is active and autostarts
shell: |
virsh net-start default || true
virsh net-autostart default || true
become: yes
- name: Add current user to libvirt group
user:
name: "{{ ansible_facts['user_id'] }}"
groups: libvirt
append: yes
become: yes
ignore_errors: yes # Some distros use different group names (e.g., kvm)