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:
@@ -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
|
||||
|
||||
37
roles/common/tasks/virtualization.yml
Normal file
37
roles/common/tasks/virtualization.yml
Normal 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
|
||||
Reference in New Issue
Block a user