1
0
mirror of https://gitlab.com/dbrw/ansible-setup.git synced 2026-02-06 00:05:32 +07:00

update config

This commit is contained in:
dbrw
2022-07-07 12:06:50 +07:00
parent 787bb4563f
commit 0b31d606b1
5 changed files with 70 additions and 2 deletions

View File

@@ -58,6 +58,9 @@
- include_tasks: keyboard.yml
when: install_keyboard == True
- include_tasks: virtualization.yml
when: install_virtualization == True
# Dotfiles
- include_tasks: dotfiles.yml
when: pull_dotfiles == True

View File

@@ -0,0 +1,37 @@
- name: Install kvm virtualization
pacman:
name:
- virt-manager
- qemu-desktop
- libvirt
- dmidecode
- edk2-ovmf
- dnsmasq
- iptables-nft
- name: update qemu.conf
lineinfile:
path: /etc/libvirt/qemu.conf
regexp: '{{ item.regexp }}'
line: '{{ item.replace }}'
with_items:
- { regexp: '^#user = ', replace: 'user = "{{ username }}"' }
- { regexp: '^#group = ', replace: 'group = "{{ username }}"' }
- name: Add user {{ username }} to libvirt group
ansible.builtin.user:
groups: libvirt
append: True
user: "{{ username }}"
- name: Define a new network for virtualization
community.libvirt.virt_net:
command: define
name: jungle
xml: '{{ lookup("template", "libvirt/jungle.xml") }}'
- name: Ensure virtualization network active
community.libvirt.virt_net:
autostart: yes
state: active
name: jungle