-
Notifications
You must be signed in to change notification settings - Fork 1
/
7poucesHdmi.yml
304 lines (238 loc) · 7.86 KB
/
7poucesHdmi.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
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
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
---
- hosts: Pi7P
remote_user: sysop
become: yes
tasks:
- name: Maj dépôts
apt:
upgrade: yes
update_cache: yes
- name: install git
apt:
name: git
state: present
- name: install "7zip"
apt:
name: p7zip-full
state: present
- name: install "xserver-xorg"
apt:
name: xserver-xorg
state: present
- name: install "x11-xserver-utils"
apt:
name: x11-xserver-utils
state: present
- name: install "xinit"
apt:
name: xinit
state: present
- name: install "xserver-xorg-video-fbturbo"
apt:
name: xserver-xorg-video-fbturbo
state: present
- name: install "xdotool"
apt:
name: xdotool
state: present
- name: install "openbox"
apt:
name: openbox
state: present
- name: install "chromium-browser"
apt:
name: chromium-browser
state: present
- name: Lire fichier .bashrc
shell: cat /home/sysop/.bashrc
register: startx_command
- name: Ajout lancement serveur X (startx)
shell: |
echo 'export TYPE_SERVEUR_NFC={{ nfc }}' >> /home/sysop/.bashrc
echo '#modif bashrc = ok' >> /home/sysop/.bashrc
echo '[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor' >> /home/sysop/.bashrc
when: startx_command.stdout.find('#modif bashrc = ok') == -1
- name: Copie du fichier autostart
copy:
src: ./autostart
dest: /home/sysop/autostart
owner: sysop
group: sysop
mode: '0770'
backup: yes
- name: Remplacer le fichier autostart
shell:
cmd: cp /home/sysop/autostart /etc/xdg/openbox/autostart
# config de l ecran
- name: Création du dossier repos "LCD-show"
file:
path: /home/sysop/LCD-show
state: directory
mode: '0775'
- name: Rapatrier le driver de l'écran
git:
repo: https://github.com/goodtft/LCD-show.git
dest: /home/sysop/LCD-show/
clone: yes
update: no
- name: Configuration écran 1024x600 pixels!
replace:
path: /home/sysop/LCD-show/LCD7C-show
regexp: '^sudo reboot$'
replace: '#remove reboot'
- name: Rendre exécutable le fichier de configuration 1024x600
shell: |
chmod +x LCD7C-show
./LCD7C-show
echo "hdmi:capacity:7C-1024x600:0:1024:600" > /root/.have_installed
args:
chdir: /home/sysop/LCD-show/
- name: Configuration de xorg en fonction rotate =
shell: |
sed -i '/Option "CalibrationMatrix"/c Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1"' /etc/X11/xorg.conf.d/40-libinput.conf
when: rotate == 1
shell: |
sed -i '/Option "CalibrationMatrix"/c Option "CalibrationMatrix" "0 -1 1 1 0 0 0 0 1"' /etc/X11/xorg.conf.d/40-libinput.conf
when: rotate == 3
- name: Configuration de config.txt
shell: |
echo "display_rotate={{ rotate }}" >> /boot/config.txt
### Cas NFC USB
- name: install "libpcsclite1"
apt:
name: libpcsclite1
state: present
when: nfc == 'acr122u-u9'
- name: install "libpcsclite-dev"
apt:
name: libpcsclite-dev
state: present
when: nfc == 'acr122u-u9'
- name: install "pcscd"
apt:
name: pcscd
state: present
when: nfc == 'acr122u-u9'
- name: install "pcsc-tools"
apt:
name: pcsc-tools
state: present
when: nfc == 'acr122u-u9'
- name: Copie du fichier blacklist.conf (ne pas déscativer ses modules)
copy:
src: ./blacklist.conf
dest: /etc/modprobe.d/blacklist.conf
owner: sysop
group: sysop
mode: '0644'
backup: yes
when: nfc == 'acr122u-u9'
#### Fin Nfc USB
#### Cas GPIO
- name: Changer le propriétaire et le groupe dupériphérique
shell: chown root:gpio /dev/gpiomem
- name: Configurer les droits du groupe en lecture ecriture
shell: chmod g+rw /dev/gpiomem
- name: Ajout de l'utilisateur au groupe gpio
shell: usermod -a -G gpio $USER
- name: Ajout de l'utilisateur au groupe spi
shell: usermod -a -G spi $USER
- name: Ajout de l'utilisateur au groupe netdev
shell: usermod -a -G netdev $USER
#### Fin GPIO
- name: Ajout du dépot nodes js
shell: curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
- name: install "nodejs"
apt:
name: nodejs
state: present
- name: Pour nodejs, installation de "gcc" pour la compilation
apt:
name: gcc
state: present
- name: Pour nodejs, installation de "g++" pour la compilation
apt:
name: g++
state: present
- name: Pour nodejs, installation de "make" pour la compilation
apt:
name: make
state: present
- name: Pour nodejs, installation de "apt-transport-https" pour la compilation
apt:
name: apt-transport-https
state: present
- name: Copie du fichier serveurNfc.7z
copy:
src: ./serveurNfc.7z
dest: /home/sysop/serveurNfc.7z
owner: sysop
group: sysop
backup: yes
# when: nfc == 'acr122u-u9'
- name: décompresser le fichier serveurNfc.7z
shell: |
7z x serveurNfc.7z
chmod -R 774 serveurNfcNodeJsVma405
chown -R root:sysop serveurNfcNodeJsVma405
args:
chdir: /home/sysop/
# when: nfc == 'acr122u-u9'
- name: Installer les modules node js pour serveurNfc
shell:
cmd: npm i
args:
chdir: /home/sysop/serveurNfcNodeJsVma405/
# when: nfc == 'acr122u-u9'
- name: Maj .chromium_env
shell: |
sed -i "/^hostname = */c hostname = {{ hostname }}" /home/sysop/serveurNfcNodeJsVma405/.chromium_env
sed -i "/^front_type = */c front_type = {{ frontType }}" /home/sysop/serveurNfcNodeJsVma405/.chromium_env
sed -i "/^password = */c password = {{ password }}" /home/sysop/serveurNfcNodeJsVma405/.chromium_env
sed -i "/^token = */c token = {{ token }}" /home/sysop/serveurNfcNodeJsVma405/.chromium_env
sed -i "/^url = */c url = {{ protocole }}://{{ serveur }}/wv/login_hardware" /home/sysop/serveurNfcNodeJsVma405/.chromium_env
# when: nfc == 'acr122u-u9'
- name: Autologin
shell:
cmd: raspi-config nonint do_boot_behaviour B2
##### Ajout :
# - name: Ajouter la rotation de 90° au fichier de configuration /boot/config.txt
# shell:
# cmd: echo "display_rotate=3 " >> /boot/config.txt
- name: installe "splash screen"
apt:
name: rpd-plym-splash
state: present
- name: Installation de "fbi", pour visualiser le splash screen(logo)
apt:
name: fbi
state: present
- name: Copie du fichier image splash.png
copy:
src: ./splash.png
dest: /home/sysop/splash.png
owner: sysop
group: sysop
backup: yes
- name: Suppression du logo raspberry pi, modification du fichier /boot/cmdline.txt
shell:
cmd: echo "\nconsoleblank=0 loglevel=1 quiet logo.nologo" >> /boot/cmdline.txt
- name: Autoriser startx
shell:
cmd: sed -i "s/quiet splash plymouth.ignore-serial-consoles//" /boot/cmdline.txt
- name: Copie du fichier du service "splashscreen.service"
copy:
src: ./splashscreen.service
dest: /etc/systemd/system/splashscreen.service
owner: sysop
group: sysop
mode: '0770'
backup: yes
- name: Activer "splashscreen.service"
shell:
cmd: sudo systemctl enable splashscreen.service
- name: Démarrer "splashscreen.service"
shell:
cmd: sudo systemctl start splashscreen.service
- name: Redémarrage !
reboot: