Skip to content

Commit 4c92c1e

Browse files
committed
Removed unused files; Rewrote build script
1 parent c79f856 commit 4c92c1e

File tree

11 files changed

+158
-941
lines changed

11 files changed

+158
-941
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS*
22
venv
3-
hosts
3+
hosts
4+
vars.yml

build.yml

Lines changed: 148 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
- hosts: all
22
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
95

6+
tasks:
107
- name: Hostname
118
hostname:
129
name: "{{ camname | default('cambuild') }}"
@@ -36,28 +33,18 @@
3633
- libwebp6
3734
- libtiff5
3835

39-
- name: Install GPIO Python 3
36+
- name: Install Python 3 pip
4037
apt:
4138
name:
42-
- python3-rpi.gpio
4339
- python3-pip
4440
- python-pip
4541
state: latest
4642
become: yes
4743

4844
- name: Install setuptools
49-
pip:
50-
name: setuptools
51-
state: present
52-
53-
- name: Install Python dependencies
5445
pip:
5546
executable: /usr/bin/pip3
56-
name:
57-
- rpi_ws281x
58-
- adafruit-circuitpython-neopixel
59-
- zeroconf
60-
- libconf
47+
name: setuptools
6148
state: present
6249

6350
- name: Getty TTY1
@@ -104,7 +91,7 @@
10491

10592
- name: Install SSH key
10693
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 }}"
10895
user: pi
10996
state: present
11097

@@ -166,75 +153,75 @@
166153
name: busybox-syslogd
167154
state: latest
168155

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"
175162

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"
182169

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"
192179

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
198185

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
209196

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
219206

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
225212

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
232219

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
238225

239226
- name: Create raspindi
240227
file:
@@ -252,49 +239,107 @@
252239

253240
- name: Setup NDI
254241
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
256244
dest: /opt/raspindi/
257245
creates: /opt/raspindi/lib/libndi.so
258246

259247
- name: Setup OpenCV
260248
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
262251
dest: /opt/raspindi/
263252
creates: /opt/raspindi/lib/libopencv_core.so
264253

265254
- name: Setup RaspiCam
266255
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
268258
dest: /opt/raspindi/
269259
creates: /opt/raspindi/lib/libraspicam.so
270260

271261
- 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
275265
owner: pi
276266
group: pi
277267
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
289334

290335
- name: Startup scripts
291336
lineinfile:
292337
dest: /home/pi/.bashrc
293338
line: /opt/raspindi/bin/startup
294339

295340
- 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
298343
dest: /etc/systemd/system/neopixel.service
299344

300345
- name: Enable Neopixel service
@@ -304,8 +349,8 @@
304349
enabled: yes
305350

306351
- 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
309354
dest: /boot/raspindi.conf
310355

311356
- name: Link config file
@@ -324,8 +369,8 @@
324369
state: present
325370

326371
- 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
329374
dest: /usr/share/plymouth/themes/pix/splash.png
330375

331376
- name: Shut down

0 commit comments

Comments
 (0)