-
Notifications
You must be signed in to change notification settings - Fork 9
/
ubuntu.yml
66 lines (65 loc) · 1.94 KB
/
ubuntu.yml
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
- hosts: localhost
connection: local
tasks:
- name: Creating LXD container
lxd_container:
name: "{{ item }}"
state: started
config:
limits.cpu: "2"
limits.memory: 4GB
limits.memory.swap: "false"
linux.kernel_modules: ip_tables,ip6_tables,netlink_diag,nf_nat,overlay
raw.lxc: |
lxc.apparmor.profile=unconfined
lxc.cap.drop=
lxc.cgroup.devices.allow=a
lxc.mount.auto=proc:rw sys:rw
security.nesting: "true"
security.privileged: "true"
environment.DISPLAY: :0
raw.idmap: both 1000 1000
user.user-data: |
#cloud-config
runcmd:
- 'sed -i "s/; enable-shm = yes/enable-shm = no/g" /etc/pulse/client.conf'
- 'echo export PULSE_SERVER=unix:/tmp/.pulse-native | tee --append /home/ubuntu/.profile'
packages:
- x11-apps
- mesa-utils
- pulseaudio
description: GUI LXD profile
devices:
PASocket:
path: /tmp/.pulse-native
source: /run/user/1000/pulse/native
type: disk
X0:
path: /tmp/.X11-unix/X0
source: /tmp/.X11-unix/X0
type: disk
mygpu:
type: gpu
source:
type: image
mode: pull
server: https://cloud-images.ubuntu.com/releases
protocol: simplestreams
alias: 19.04/amd64
profiles: ["default"]
wait_for_ipv4_addresses: true
timeout: 600
with_items: # launch LXD instance
- ubuntu
- name: Install Firefox and its dependecies
delegate_to: "ubuntu"
apt:
name: "{{ packages }}"
state: present
update_cache: yes
vars:
packages:
- libcanberra-gtk-module
- libcanberra-gtk3-module
- dbus-x11
- firefox