-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvirtualbox.sls
45 lines (40 loc) · 1.51 KB
/
virtualbox.sls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
oracle_vbox_repo:
pkgrepo.managed:
- name: deb http://download.virtualbox.org/virtualbox/debian {{ grains['lsb_distrib_codename'] }}
# contrib section since 4.0 (https://www.virtualbox.org/wiki/Linux_Downloads#Debian-basedLinuxdistributions)
- comps: contrib
- file: /etc/apt/sources.list.d/oracle_vbox.list
{% if grains['osmajorrelease'] > 14 %}
- key_url: https://www.virtualbox.org/download/oracle_vbox_2016.asc
{% else %}
- key_url: http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc
{% endif %}
vbox_dependencies:
pkg.installed:
- pkgs:
- dkms
- linux-headers-{{ grains['kernelrelease'] }}
virtualbox:
pkg.installed:
- name: virtualbox-5.2
- require:
- pkgrepo: oracle_vbox_repo
- pkg: vbox_dependencies
{# https://www.virtualbox.org/wiki/Linux_Downloads #}
{% set url = 'https://download.virtualbox.org/virtualbox/5.2.20/Oracle_VM_VirtualBox_Extension_Pack-5.2.20.vbox-extpack' %}
{% set hash_url = 'https://www.virtualbox.org/download/hashes/5.2.20/SHA256SUMS' %}
{% set filename = url.split('/')[-1] %}
{% set path = '/var/tmp/%s' % filename %}
extpack_file:
file.managed:
- name: {{ path }}
- source: {{ url }}
- source_hash: {{ hash_url }}
extpack_install:
cmd.run:
{# please note that this accepts the EULA #}
- name: yes | vboxmanage extpack install {{ path }}
- unless: "vboxmanage list extpacks | grep 'Oracle VM VirtualBox Extension Pack'"
- require:
- pkg: virtualbox
- file: extpack_file