-
Notifications
You must be signed in to change notification settings - Fork 0
/
raspberry.yaml
265 lines (213 loc) · 8.96 KB
/
raspberry.yaml
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
- hosts: all
become: yes
remote_user: pi
roles:
- disable-raspi-config
tasks:
- name: Update package cache if older than one hour (apt-get update)
apt: update_cache=yes cache_valid_time=3600
- name: Upgrade all old packages (apt-get dist-upgrade)
apt: upgrade=dist
- name: Install useful utilities
apt: name={{ item }} state=present
with_items:
- mc
- telnet
- vim
- debsums
- name: Remove rubbish Raspberry Pi packages
apt: name={{ item }} state=absent purge=yes
with_items:
- blt
- claws-mail
- claws-mail-i18n
- coinor-libcbc3
- coinor-libcgl1
- coinor-libclp1
- coinor-libcoinmp1
- coinor-libcoinutils3
- coinor-libosi1
- dillo
- epiphany-browser
- epiphany-browser-data
- eject
- gpicview
- idle
- idle-python2.7
- idle-python3.2
- idle3
- idle-python3.4
- lp-solve
- minecraft-pi
- netsurf-common
- netsurf-gtk
- nodejs
- nodejs-legacy
- nodered
- omxplayer
- penguinspuzzle
- pistore
- python-minecraftpi
- python-tk
- python3-minecraftpi
- python3-tk
- scratch
- smartsim
- squeak-plugins-scratch
- squeak-vm
- wolfram-engine
- xpdf
- zenity
- zenity-common
- name: Remove Bluetooth support
apt: name={{ item }} state=absent purge=yes
with_items:
- libbluetooth3
- bluez
- bluez-firmware
- pi-bluetooth
- name: Remove mDNS support
apt: name={{ item }} state=absent purge=yes
with_items:
- avahi-daemon
- libnss-mdns
- name: Remove Libreoffice packages
apt: name={{ item }} state=absent purge=yes
with_items:
- libreoffice
- libreoffice-avmedia-backend-gstreamer
- libreoffice-base
- libreoffice-base-core
- libreoffice-base-drivers
- libreoffice-calc
- libreoffice-common
- libreoffice-core
- libreoffice-draw
- libreoffice-gtk
- libreoffice-impress
- libreoffice-java-common
- libreoffice-math
- libreoffice-report-builder-bin
- libreoffice-sdbc-hsqldb
- libreoffice-style-galaxy
- libreoffice-writer
- uno-libs3
- ure
- name: Remove ALSA and other sound-related packages
apt: name={{ item }} state=absent purge=yes
with_items:
- alsa-base
- alsa-utils
- esound-common
- freepats
- jackd
- jackd2
- libesd0
- libjack-jackd2-0
- libsclang1
- libscsynth1
- sonic-pi
- supercollider
- supercollider-common
- supercollider-server
- timidity
- qjackctl
- name: Remove lightdm so default X11 desktop doesn't start
apt: name=lightdm state=absent purge=yes
- name: Remove CUPS packages
apt: name={{ item }} state=absent purge=yes
with_items:
- cups-bsd
- cups-client
- cups-common
- name: Remove dphys-swapfile package
apt: name=dphys-swapfile state=absent purge=yes
# - name: Remove remaining dependencies of other packages (apt-get autoremove)
# shell: apt-get autoremove
- name: Remove old /var/swap file
file: path=/var/swap state=absent
- name: Set the timezone to Europe/Warsaw
copy: src=/usr/share/zoneinfo/Europe/Warsaw dest=/etc/localtime mode=0644
- name: Install cpufrequtils
apt: name=cpufrequtils state=present
- name: Configure cpufrequtils
copy: src=files/etc/default/cpufrequtils dest=/etc/default/cpufrequtils mode=0644
notify: restart cpufrequtils
- name: Set disable_overscan=1 in /boot/config.txt
lineinfile: dest=/boot/config.txt line="disable_overscan=1"
- name: Set hdmi_force_hotplug=1 in /boot/config.txt (force HDMI output)
lineinfile: dest=/boot/config.txt line="hdmi_force_hotplug=1"
- name: Set hdmi_group=1 in /boot/config.txt (force HD 1080p output)
lineinfile: dest=/boot/config.txt line="hdmi_group=1"
- name: Set hdmi_mode=16 in /boot/config.txt (force HD 1080p output)
lineinfile: dest=/boot/config.txt line="hdmi_mode=16"
- name: Set BLANK_TIME=0 in /etc/kbd/config
lineinfile: dest=/etc/kbd/config regexp="^BLANK_TIME=\d+$" line="BLANK_TIME=0"
notify: restart kbd
- name: Set POWERDOWN_TIME=0 in /etc/kbd/config
lineinfile: dest=/etc/kbd/config regexp="^POWERDOWN_TIME=\d+$" line="POWERDOWN_TIME=0"
notify: restart kbd
- name: Create '/usr/share/X11/xorg.conf.d/30-disable-screen-blanking.conf' to disable X11 screen blanking
copy: src=files/usr/share/X11/xorg.conf.d/30-disable-screen-blanking.conf dest=/usr/share/X11/xorg.conf.d/30-disable-screen-blanking.conf mode=0644
- name: Install Unclutter to make mouse cursor disappear
apt: name=unclutter state=present
- name: Install xdotool to support window operations from scripts
apt: name=xdotool state=present
- name: Install Python libraries
apt: name=python-yaml state=present
- name: Create /usr/local/share/monino directory
file: dest=/usr/local/share/monino mode=0755 state=directory
- name: Install /usr/local/share/monino/browser.sh
copy: src=files/usr/local/share/monino/browser.sh dest=/usr/local/share/monino/browser.sh mode=0755
- name: Install /usr/local/share/monino/browser-chromium.sh
copy: src=files/usr/local/share/monino/browser-chromium.sh dest=/usr/local/share/monino/browser-chromium.sh mode=0755
- name: Install /usr/local/share/monino/browser-chromium-maximize.sh
copy: src=files/usr/local/share/monino/browser-chromium-maximize.sh dest=/usr/local/share/monino/browser-chromium-maximize.sh mode=0755
- name: Install /usr/local/share/monino/xsession.sh
copy: src=files/usr/local/share/monino/xsession.sh dest=/usr/local/share/monino/xsession.sh mode=0755
- name: Create an empty /usr/local/share/monino/chromium-config directory
file: name=/usr/local/share/monino/chromium-config state=directory mode=0755
- name: Create a "First Run" file in /usr/local/share/monino/chromium-config
copy: src="files/usr/local/share/monino/chromium-config/First Run" dest="/usr/local/share/monino/chromium-config/First Run" mode=0644
- name: Create a "Local State" file in /usr/local/share/monino/chromium-config
copy: src="files/usr/local/share/monino/chromium-config/Local State" dest="/usr/local/share/monino/chromium-config/Local State" mode=0644
- name: Create an empty /usr/local/share/monino/chromium-packages directory
file: name=/usr/local/share/monino/chromium-packages state=directory mode=0755
- name: Copy 'chromium-browser_***.deb' to /usr/local/share/monino/chromium-packages
copy: src="files/usr/local/share/monino/chromium-packages/chromium-browser_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb" dest="/usr/local/share/monino/chromium-packages/chromium-browser_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb" mode=0644
- name: Copy 'chromium-codecs-ffmpeg-extra_***.deb' to /usr/local/share/monino/chromium-packages
copy: src="files/usr/local/share/monino/chromium-packages/chromium-codecs-ffmpeg-extra_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb" dest="/usr/local/share/monino/chromium-packages/chromium-codecs-ffmpeg-extra_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb" mode=0644
# for Raspbian 8
# - name: Install Chromium browser
# shell: dpkg -i /usr/local/share/monino/chromium-packages/chromium-browser_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb /usr/local/share/monino/chromium-packages/chromium-codecs-ffmpeg-extra_49.0.2623.108-0ubuntu0.14.04.1.1113_armhf.deb
# for Raspbian 7
- name: Install Chromium browser
apt: name={{ item }} state=present
with_items:
- chromium
- chromium-browser
- name: Install VNC server package
apt: name=x11vnc state=present
- name: Create a 'monino' group
group: name=monino
- name: Create a 'monino' user
user: name=monino group=monino shell=/bin/bash createhome=yes home=/home/monino
- name: Create /home/monino/.xsession
copy: src=files/home/monino/.xsession dest=/home/monino/.xsession owner=monino group=monino mode=0644
- name: Create default /home/monino/config.yaml (only if it doesn't exist)
copy: src=files/home/monino/config.yaml dest=/home/monino/config.yaml owner=monino group=monino mode=0644 force=no
- name: Install supervisord
apt: name=supervisor state=present
- name: Create /etc/supervisor/conf.d/monino.conf
copy: src=files/etc/supervisor/conf.d/monino.conf dest=/etc/supervisor/conf.d/monino.conf
notify: supervisorctl reread
handlers:
- name: restart kbd
service: name=kbd state=restarted
- name: restart cpufrequtils
service: name=cpufrequtils state=restarted
- name: supervisorctl reread
command: supervisorctl reread
notify: supervisorctl update
- name: supervisorctl update
command: supervisorctl update