---
- name: Install VirtualBox and dependencies
  pacman:
    name:
      - net-tools
      - qt4
      - virtualbox
      - virtualbox-guest-iso
      - virtualbox-host-dkms
    state: present

- name: Install VirtualBox extensions
  aur: name=virtualbox-ext-oracle user={{ user.name }}
  tags:
    - aur

- name: Add the user to vboxusers group
  user: name={{ user.name }} groups=vboxusers append=yes
  tags:
    - user
