-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanu-install.yml
90 lines (78 loc) · 2.27 KB
/
anu-install.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
---
- name: Install anu
hosts: "{{ variable_host | default('anu-local') }}"
become: yes
vars_files:
- vars/default.yml
tasks:
- name: Install dependencies
apt:
pkg:
- git
- jackd2
- i2c-tools
- python3-pil
- python3-dev
- python3-pip
- python3-setuptools
- python3-rpi.gpio
- python-smbus
- libopenjp2-7-dev
- libjack-jackd2-dev
update_cache: yes
environment:
DEBIAN_FRONTEND: noninteractive
# used to set jackd realtime prio here but now it seems to be set by default
# cp /etc/security/limits.d/audio.conf.disabled /etc/security/limits.d/audio.conf
- name: Copy module file
copy:
src: files/modules
dest: /etc/modules
- name: Copy JackTrip binary
copy:
src: files/jacktrip
dest: /usr/local/bin/jacktrip
mode: u+rwx,g+rx,o+rx
- name: Download and unarchive jackmeter
ansible.builtin.unarchive:
src: https://www.aelius.com/njh/jackmeter/jackmeter-0.4.tar.gz
dest: /home/{{user}}/
remote_src: yes
- name: Install jackmeter
command: "{{ item }}"
with_items:
- ./configure
- make
- make install
args:
chdir: jackmeter-0.4/
- name: Template darkice config file
template:
src: templates/system/config.txt.j2
dest: /boot/config.txt
- name: Git checkout anu
git:
repo: 'https://github.com/noiseorchestra/autonomous-noise-unit.git'
dest: /home/{{user}}/autonomous-noise-unit
version: 2.0.0
become: yes
become_user: pi
- name: Install noisebox python dependencies
command: python3 -m pip install -r /home/{{user}}/autonomous-noise-unit/requirements.txt
become: yes
become_user: pi
- name: Template ANU config file
template:
src: templates/noisebox/config.ini.j2
dest: /home/{{user}}/autonomous-noise-unit/config.ini
become: yes
become_user: pi
- name: Copy service files
copy:
src: files/noisebox.service
dest: "/etc/systemd/system/"
- name: Start and enable services
service:
name: noisebox
state: started
enabled: yes