mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Optimized virtualbox draft
This commit is contained in:
28
roles/desk-virtualbox/tasks/main.yml
Normal file
28
roles/desk-virtualbox/tasks/main.yml
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Install VirtualBox and kernel modules
|
||||
become: true
|
||||
pacman:
|
||||
name: >-
|
||||
virtualbox
|
||||
{{ lookup('pipe', "pacman -Qsq '^linux' | grep '^linux[0-9]*[-rt]*$' | awk '{print $1 \"-virtualbox-host-modules\"}' ORS=' '") }}
|
||||
state: present
|
||||
update_cache: true
|
||||
|
||||
- name: Load vbox kernel modules
|
||||
become: true
|
||||
command: vboxreload
|
||||
register: vboxreload_output
|
||||
failed_when: vboxreload_output.rc != 0 and '"vboxdrv"' not in vboxreload_output.stderr
|
||||
|
||||
- name: Build and install Oracle VirtualBox extension pack
|
||||
become: true
|
||||
command: pamac build --no-confirm virtualbox-ext-oracle
|
||||
args:
|
||||
creates: /usr/lib/virtualbox/ExtensionPacks/Oracle_VM_VirtualBox_Extension_Pack
|
||||
|
||||
- name: Add current user to vboxusers group
|
||||
become: true
|
||||
user:
|
||||
name: "{{ lookup('env','USER') }}"
|
||||
groups: vboxusers
|
||||
append: yes
|
Reference in New Issue
Block a user