|
1 | 1 | - hosts: all
|
2 | 2 | become: yes
|
3 |
| - tasks: |
4 |
| - - name: Copy SSH key |
5 |
| - authorized_key: |
6 |
| - user: pi |
7 |
| - state: present |
8 |
| - key: "{{ lookup('file', '/Users/richard/.ssh/id_rsa.pub') }}" |
| 3 | + vars_files: |
| 4 | + - vars.yml |
9 | 5 |
|
| 6 | + tasks: |
10 | 7 | - name: Hostname
|
11 | 8 | hostname:
|
12 | 9 | name: "{{ camname | default('cambuild') }}"
|
|
36 | 33 | - libwebp6
|
37 | 34 | - libtiff5
|
38 | 35 |
|
39 |
| - - name: Install GPIO Python 3 |
| 36 | + - name: Install Python 3 pip |
40 | 37 | apt:
|
41 | 38 | name:
|
42 |
| - - python3-rpi.gpio |
43 | 39 | - python3-pip
|
44 | 40 | - python-pip
|
45 | 41 | state: latest
|
46 | 42 | become: yes
|
47 | 43 |
|
48 | 44 | - name: Install setuptools
|
49 |
| - pip: |
50 |
| - name: setuptools |
51 |
| - state: present |
52 |
| - |
53 |
| - - name: Install Python dependencies |
54 | 45 | pip:
|
55 | 46 | executable: /usr/bin/pip3
|
56 |
| - name: |
57 |
| - - rpi_ws281x |
58 |
| - - adafruit-circuitpython-neopixel |
59 |
| - - zeroconf |
60 |
| - - libconf |
| 47 | + name: setuptools |
61 | 48 | state: present
|
62 | 49 |
|
63 | 50 | - name: Getty TTY1
|
|
104 | 91 |
|
105 | 92 | - name: Install SSH key
|
106 | 93 | authorized_key:
|
107 |
| - key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDt1pSSB8GXAUPlkc9hyYjrGMcomyvN3H3VePzapm3CXU8KSU9ovyItwC2QhV8oKJq+KJgCZnOV3NSrzUqvzyuS1TClS4rMjJqEabnR9jf9ljDX7bjEiFQB+UDLgUKZ9mZOJ+fWIzIZ6MoQ1FNj1WNkc/vDzGzZ2Ma6v8IelYNnpcvrAVP9fXjaGwXexfqoSxJTqSD+b3ue/MWpYWugEdbAF/i3pU+Ko+b+VLMJhrLgXaNHraedglB0jJ4Hpsx9RLDvMITwJJUa/T50s7OtwfEds2HWdD6FmyCwDri3VgMFCTiNOGJWvmw0hnD0Pygm4eRGDPO68GLjTg85AWhpnB5ASG0VOPcwhVPQ6WPITbd9YFsGDIOyBk7wi//GqlWJxzclpbZD65fukxgSiBHEjDYK0/0vWmxItmiXjwP155l0BjLSMPc5LSSsS+q31jL+RzoFKIfL+7ZKSd3cxVME4g6ifGCpCcrk3PnCSUou6J5827w+R08Tkm4x1lZiDhyCKFk= richard@ubsms.org.uk |
| 94 | + key: "{{ ssh_key }}" |
108 | 95 | user: pi
|
109 | 96 | state: present
|
110 | 97 |
|
|
166 | 153 | name: busybox-syslogd
|
167 | 154 | state: latest
|
168 | 155 |
|
169 |
| - - name: fstab change (ro boot) |
170 |
| - replace: |
171 |
| - backup: no |
172 |
| - dest: /etc/fstab |
173 |
| - regexp: "^(.*vfat.*)defaults(?:,ro)?(.*)" |
174 |
| - replace: "\\1defaults,ro\\2" |
| 156 | + # - name: fstab change (ro boot) |
| 157 | + # replace: |
| 158 | + # backup: no |
| 159 | + # dest: /etc/fstab |
| 160 | + # regexp: "^(.*vfat.*)defaults(?:,ro)?(.*)" |
| 161 | + # replace: "\\1defaults,ro\\2" |
175 | 162 |
|
176 |
| - - name: fstab change (ro rootfs) |
177 |
| - replace: |
178 |
| - backup: no |
179 |
| - dest: /etc/fstab |
180 |
| - regexp: "^(.*ext4.*)defaults(?:,ro)?(.*)" |
181 |
| - replace: "\\1defaults,ro\\2" |
| 163 | + # - name: fstab change (ro rootfs) |
| 164 | + # replace: |
| 165 | + # backup: no |
| 166 | + # dest: /etc/fstab |
| 167 | + # regexp: "^(.*ext4.*)defaults(?:,ro)?(.*)" |
| 168 | + # replace: "\\1defaults,ro\\2" |
182 | 169 |
|
183 |
| - - name: fstab tmpfs |
184 |
| - lineinfile: |
185 |
| - path: /etc/fstab |
186 |
| - line: "{{ item }}" |
187 |
| - state: present |
188 |
| - with_items: |
189 |
| - - "tmpfs /tmp tmpfs nosuid,nodev 0 0" |
190 |
| - - "tmpfs /var/log tmpfs nosuid,nodev 0 0" |
191 |
| - - "tmpfs /var/tmp tmpfs nosuid,nodev 0 0" |
| 170 | + # - name: fstab tmpfs |
| 171 | + # lineinfile: |
| 172 | + # path: /etc/fstab |
| 173 | + # line: "{{ item }}" |
| 174 | + # state: present |
| 175 | + # with_items: |
| 176 | + # - "tmpfs /tmp tmpfs nosuid,nodev 0 0" |
| 177 | + # - "tmpfs /var/log tmpfs nosuid,nodev 0 0" |
| 178 | + # - "tmpfs /var/tmp tmpfs nosuid,nodev 0 0" |
192 | 179 |
|
193 |
| - - name: Create dhcpcd.resolv.conf |
194 |
| - copy: |
195 |
| - src: /etc/resolv.conf |
196 |
| - dest: /tmp/dhcpcd.resolv.conf |
197 |
| - remote_src: yes |
| 180 | + # - name: Create dhcpcd.resolv.conf |
| 181 | + # copy: |
| 182 | + # src: /etc/resolv.conf |
| 183 | + # dest: /tmp/dhcpcd.resolv.conf |
| 184 | + # remote_src: yes |
198 | 185 |
|
199 |
| - - name: Delete stuff |
200 |
| - file: |
201 |
| - path: "{{ item }}" |
202 |
| - state: absent |
203 |
| - with_items: |
204 |
| - - /var/lib/dhcp |
205 |
| - - /var/lib/dhcpcd5 |
206 |
| - - /var/spool |
207 |
| - - /etc/resolv.conf |
208 |
| - - /var/lib/systemd/random-seed |
| 186 | + # - name: Delete stuff |
| 187 | + # file: |
| 188 | + # path: "{{ item }}" |
| 189 | + # state: absent |
| 190 | + # with_items: |
| 191 | + # - /var/lib/dhcp |
| 192 | + # - /var/lib/dhcpcd5 |
| 193 | + # - /var/spool |
| 194 | + # - /etc/resolv.conf |
| 195 | + # - /var/lib/systemd/random-seed |
209 | 196 |
|
210 |
| - - name: Link stuff to tmpfs |
211 |
| - file: |
212 |
| - src: /tmp |
213 |
| - dest: "{{ item }}" |
214 |
| - state: link |
215 |
| - with_items: |
216 |
| - - /var/lib/dhcp |
217 |
| - - /var/lib/dhcpcd5 |
218 |
| - - /var/spool |
| 197 | + # - name: Link stuff to tmpfs |
| 198 | + # file: |
| 199 | + # src: /tmp |
| 200 | + # dest: "{{ item }}" |
| 201 | + # state: link |
| 202 | + # with_items: |
| 203 | + # - /var/lib/dhcp |
| 204 | + # - /var/lib/dhcpcd5 |
| 205 | + # - /var/spool |
219 | 206 |
|
220 |
| - - name: Link dhcpcd.resolv.conf |
221 |
| - file: |
222 |
| - src: /tmp/dhcpcd.resolv.conf |
223 |
| - dest: /etc/resolv.conf |
224 |
| - state: link |
| 207 | + # - name: Link dhcpcd.resolv.conf |
| 208 | + # file: |
| 209 | + # src: /tmp/dhcpcd.resolv.conf |
| 210 | + # dest: /etc/resolv.conf |
| 211 | + # state: link |
225 | 212 |
|
226 |
| - - name: Link random-seed |
227 |
| - file: |
228 |
| - src: /tmp/random-seed |
229 |
| - dest: /var/lib/systemd/random-seed |
230 |
| - state: link |
231 |
| - force: yes |
| 213 | + # - name: Link random-seed |
| 214 | + # file: |
| 215 | + # src: /tmp/random-seed |
| 216 | + # dest: /var/lib/systemd/random-seed |
| 217 | + # state: link |
| 218 | + # force: yes |
232 | 219 |
|
233 |
| - - name: Alter random-seed service |
234 |
| - lineinfile: |
235 |
| - dest: /lib/systemd/system/systemd-random-seed.service |
236 |
| - line: ExecStartPre=/bin/echo "" >/tmp/random-seed |
237 |
| - insertafter: RemainAfterExit=yes |
| 220 | + # - name: Alter random-seed service |
| 221 | + # lineinfile: |
| 222 | + # dest: /lib/systemd/system/systemd-random-seed.service |
| 223 | + # line: ExecStartPre=/bin/echo "" >/tmp/random-seed |
| 224 | + # insertafter: RemainAfterExit=yes |
238 | 225 |
|
239 | 226 | - name: Create raspindi
|
240 | 227 | file:
|
|
252 | 239 |
|
253 | 240 | - name: Setup NDI
|
254 | 241 | unarchive:
|
255 |
| - src: files/ndi-4.5.2-pi.tar.gz |
| 242 | + remote_src: yes |
| 243 | + src: https://github.com/raspberry-pi-camera/raspindi/releases/download/v{{ raspindi_version }}/ndi.tar.gz |
256 | 244 | dest: /opt/raspindi/
|
257 | 245 | creates: /opt/raspindi/lib/libndi.so
|
258 | 246 |
|
259 | 247 | - name: Setup OpenCV
|
260 | 248 | unarchive:
|
261 |
| - src: files/opencv-4.4.0-pi.tar.gz |
| 249 | + remote_src: yes |
| 250 | + src: https://github.com/raspberry-pi-camera/raspindi/releases/download/v{{ raspindi_version }}/opencv.tar.gz |
262 | 251 | dest: /opt/raspindi/
|
263 | 252 | creates: /opt/raspindi/lib/libopencv_core.so
|
264 | 253 |
|
265 | 254 | - name: Setup RaspiCam
|
266 | 255 | unarchive:
|
267 |
| - src: files/raspicam-0.1.2.tar.gz |
| 256 | + remote_src: yes |
| 257 | + src: https://github.com/raspberry-pi-camera/raspindi/releases/download/v{{ raspindi_version }}/raspicam.tar.gz |
268 | 258 | dest: /opt/raspindi/
|
269 | 259 | creates: /opt/raspindi/lib/libraspicam.so
|
270 | 260 |
|
271 | 261 | - name: Install raspindi
|
272 |
| - copy: |
273 |
| - src: files/{{ item.src }} |
274 |
| - dest: /opt/raspindi/bin/{{ item.dst }} |
| 262 | + get_url: |
| 263 | + url: https://github.com/raspberry-pi-camera/raspindi/releases/download/v{{ raspindi_version }}/raspindi |
| 264 | + dest: /opt/raspindi/bin/raspindi |
275 | 265 | owner: pi
|
276 | 266 | group: pi
|
277 | 267 | mode: 0755
|
278 |
| - with_items: |
279 |
| - - src: raspindi |
280 |
| - dst: raspindi |
281 |
| - - src: camera.py |
282 |
| - dst: camera |
283 |
| - - src: neopixel.py |
284 |
| - dst: neopixel |
285 |
| - - src: startup.sh |
286 |
| - dst: startup |
287 |
| - - src: atem.py |
288 |
| - dst: atem |
| 268 | + |
| 269 | + - name: Install Atem Tally |
| 270 | + get_url: |
| 271 | + url: https://github.com/raspberry-pi-camera/atem-tally/raw/v{{ atem_version }}/atem.py |
| 272 | + dest: /opt/raspindi/bin/atem |
| 273 | + owner: pi |
| 274 | + group: pi |
| 275 | + mode: 0755 |
| 276 | + |
| 277 | + - name: Get Atem Tally requirements |
| 278 | + get_url: |
| 279 | + url: https://github.com/raspberry-pi-camera/atem-tally/raw/v{{ atem_version }}/requirements.txt |
| 280 | + dest: /tmp/atem-requirements.txt |
| 281 | + owner: pi |
| 282 | + group: pi |
| 283 | + mode: 0755 |
| 284 | + |
| 285 | + - name: Install dependencies |
| 286 | + pip: |
| 287 | + executable: /usr/bin/pip3 |
| 288 | + requirements: /tmp/atem-requirements.txt |
| 289 | + state: present |
| 290 | + |
| 291 | + - name: Install Neopixel |
| 292 | + get_url: |
| 293 | + url: https://github.com/raspberry-pi-camera/neopixel/raw/v{{ neopixel_version }}/neopixel.py |
| 294 | + dest: /opt/raspindi/bin/neopixel |
| 295 | + owner: pi |
| 296 | + group: pi |
| 297 | + mode: 0755 |
| 298 | + |
| 299 | + - name: Get Neopixel requirements |
| 300 | + get_url: |
| 301 | + url: https://github.com/raspberry-pi-camera/neopixel/raw/v{{ neopixel_version }}/requirements.txt |
| 302 | + dest: /tmp/neopixel-requirements.txt |
| 303 | + owner: pi |
| 304 | + group: pi |
| 305 | + mode: 0755 |
| 306 | + |
| 307 | + - name: Install dependencies |
| 308 | + pip: |
| 309 | + executable: /usr/bin/pip3 |
| 310 | + requirements: /tmp/neopixel-requirements.txt |
| 311 | + state: present |
| 312 | + |
| 313 | + - name: Install Startup |
| 314 | + get_url: |
| 315 | + url: https://github.com/raspberry-pi-camera/startup/raw/v{{ startup_version }}/startup.py |
| 316 | + dest: /opt/raspindi/bin/startup |
| 317 | + owner: pi |
| 318 | + group: pi |
| 319 | + mode: 0755 |
| 320 | + |
| 321 | + - name: Get Startup requirements |
| 322 | + get_url: |
| 323 | + url: https://github.com/raspberry-pi-camera/startup/raw/v{{ startup_version }}/requirements.txt |
| 324 | + dest: /tmp/startup-requirements.txt |
| 325 | + owner: pi |
| 326 | + group: pi |
| 327 | + mode: 0755 |
| 328 | + |
| 329 | + - name: Install dependencies |
| 330 | + pip: |
| 331 | + executable: /usr/bin/pip3 |
| 332 | + requirements: /tmp/startup-requirements.txt |
| 333 | + state: present |
289 | 334 |
|
290 | 335 | - name: Startup scripts
|
291 | 336 | lineinfile:
|
292 | 337 | dest: /home/pi/.bashrc
|
293 | 338 | line: /opt/raspindi/bin/startup
|
294 | 339 |
|
295 | 340 | - name: Neopixel service
|
296 |
| - copy: |
297 |
| - src: files/neopixel.service |
| 341 | + get_url: |
| 342 | + url: https://github.com/raspberry-pi-camera/neopixel/raw/v{{ neopixel_version }}/neopixel.service |
298 | 343 | dest: /etc/systemd/system/neopixel.service
|
299 | 344 |
|
300 | 345 | - name: Enable Neopixel service
|
|
304 | 349 | enabled: yes
|
305 | 350 |
|
306 | 351 | - name: config file
|
307 |
| - copy: |
308 |
| - src: files/raspindi.conf |
| 352 | + get_url: |
| 353 | + url: https://github.com/raspberry-pi-camera/raspindi/raw/v{{ raspindi_version }}/etc/raspindi.conf.default |
309 | 354 | dest: /boot/raspindi.conf
|
310 | 355 |
|
311 | 356 | - name: Link config file
|
|
324 | 369 | state: present
|
325 | 370 |
|
326 | 371 | - name: Splash
|
327 |
| - copy: |
328 |
| - src: files/splash.png |
| 372 | + get_url: |
| 373 | + url: https://github.com/raspberry-pi-camera/raspindi/raw/v{{ raspindi_version }}/assets/splash.png |
329 | 374 | dest: /usr/share/plymouth/themes/pix/splash.png
|
330 | 375 |
|
331 | 376 | - name: Shut down
|
|
0 commit comments