diff --git a/roles/common/files/libvirt/jungle.xml b/roles/common/files/libvirt/jungle.xml new file mode 100644 index 0000000..83fb967 --- /dev/null +++ b/roles/common/files/libvirt/jungle.xml @@ -0,0 +1,12 @@ + + jungle + da5ae4c3-5a65-43c2-a5b6-91cc4f8d4f1e + + + + + + + + + diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 475c702..e02b6e2 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -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 diff --git a/roles/common/tasks/virtualization.yml b/roles/common/tasks/virtualization.yml new file mode 100644 index 0000000..208333d --- /dev/null +++ b/roles/common/tasks/virtualization.yml @@ -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 diff --git a/roles/common/templates/smb.conf.j2 b/roles/common/templates/smb.conf.j2 new file mode 100644 index 0000000..6b6ca79 --- /dev/null +++ b/roles/common/templates/smb.conf.j2 @@ -0,0 +1,13 @@ +[global] + workgroup = WORKGROUP + hosts allow = 192.168.123.0/24 + + +[win7] + path = /home/{{ username }}/Public + browseable = Yes + guest ok = No + valid users = {{ username }} + read only = No + create mask = 0755 + diff --git a/roles/common/vars/main.yml b/roles/common/vars/main.yml index 3936675..8701c26 100644 --- a/roles/common/vars/main.yml +++ b/roles/common/vars/main.yml @@ -14,8 +14,8 @@ setup_zsh: True pull_dotfiles: False dotfiles: - url: https://github.com/linuxpiper/dotfiles.git - destination: projects/dotfiles + url: https://gitlab.com/dbrw/dotfiles.git + destination: .dotfiles rcup_flags: -fx README.md ## Desktop @@ -55,6 +55,9 @@ install_doom: True ## Console-based email client install_aerc: True +## Do we want to install virt-manager and qemu kvm? +install_virtualization: True + ## AUR vars ## =========================== use_aur: True