-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfrida.yml
132 lines (122 loc) · 4.92 KB
/
frida.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
# Copyright 2018 Harri Kapanen <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- hosts: all
remote_user: pi
gather_facts: yes
become: yes
vars:
- hostname: frida
- apt_upgrade: true
- timezone: Europe/Helsinki
- nodejs_cap_net_raw_capabilities: true
- router_ip_address: 192.168.74.1
- lan_ip_address: 192.168.74.10
vars_files:
- frida-secrets.yml
roles:
- common
- influxdb
- role: grafana
grafana_port: 3000
- role: signalk-npm
signalk_settings_file: conf/signalk-settings-frida.json
signalk_security_file: conf/signalk-security.json
signalk_plugins:
- plugin_name: "@signalk/set-system-time"
plugin_config_src: conf/set-system-time.json
plugin_config_dst: set-system-time.json
- plugin_name: "@signalk/signalk-to-nmea0183"
plugin_config_src: conf/sk-to-nmea0183.json
plugin_config_dst: sk-to-nmea0183.json
- plugin_name: "@signalk/aisreporter"
plugin_config_src: conf/aisreporter.json
plugin_config_dst: aisreporter.json
- plugin_name: "@signalk/vedirect-serial-usb"
plugin_config_src: conf/vedirect-signalk.json
plugin_config_dst: vedirect-signalk.json
- plugin_name: "signalk-derived-data"
plugin_config_src: conf/derived-data.json
plugin_config_dst: derived-data.json
- plugin_name: "ais-forwarder"
plugin_config_src: conf/ais-forwarder.json
plugin_config_dst: ais-forwarder.json
- plugin_name: "signalk-ruuvitag-plugin"
plugin_config_src: conf/ruuvitag.json
plugin_config_dst: ruuvitag.json
- plugin_name: "signalk-to-influxdb"
plugin_config_src: conf/signalk-to-influxdb.json
plugin_config_dst: signalk-to-influxdb.json
- plugin_name: "signalk-rpi-monitor"
plugin_config_src: conf/signalk-rpi-monitor.json
plugin_config_dst: signalk-rpi-monitor.json
- hotspot
- role: nat_router
nat_router_local_interface: br0
nat_router_inet_interface: br0
nat_router_bridge_interfaces:
- eth0
- wlan0
nat_router_ip: "{{ lan_ip_address }}"
nat_router_gateway: "{{ router_ip_address }}"
nat_router_dhcp_range: "192.168.74.50,192.168.74.90,24h"
nat_router_dhcp_options:
- "option:router,{{ router_ip_address }}"
nat_router_dns_servers:
- "193.210.19.19" # Telia
- "8.8.8.8" # Google
nat_router_disable: true
tasks:
- name: Create InfluxDB database
ansible.builtin.uri:
url: http://localhost:8086/query?q=CREATE+DATABASE+boatdata
method: POST
- name: Restart signalk-server
service: name=signalk-server state=restarted
# Install Sailor-hat (CAN & RTC)
- name: SH-Rpi-daemon temp dir
tempfile:
state: directory
suffix: _sh_rpi
register: sh_rpi_tmpdir
- name: SH-Rpi-daemon repo clone
git:
repo: https://github.com/hatlabs/SH-RPi-daemon.git
version: unified_v1
clone: yes
update: yes
dest: "{{ sh_rpi_tmpdir.path }}"
- name: SH-Rpi-daemon install
become: yes
shell: ./install.sh --enable CAN,RTC
args:
chdir: "{{ sh_rpi_tmpdir.path }}"
executable: /bin/bash
- name: SH-Rpi-daemon temp dir delete
file:
path: "{{ sh_rpi_tmpdir.path }}"
state: absent
when: sh_rpi_tmpdir.path is defined
# udev rules for serial-usb devices
- lineinfile: path=/etc/udev/rules.d/98-frida-usb-devices.rules create=yes line="SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6001\", SYMLINK+=\"seatalk\""
- lineinfile: path=/etc/udev/rules.d/98-frida-usb-devices.rules create=yes line="SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"1546\", ATTRS{idProduct}==\"01a8\", SYMLINK+=\"gps\""
- lineinfile: path=/etc/udev/rules.d/98-frida-usb-devices.rules create=yes line="SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0b03\", SYMLINK+=\"ais\""
- lineinfile: path=/etc/udev/rules.d/98-frida-usb-devices.rules create=yes line="SUBSYSTEM==\"tty\", ATTRS{idVendor}==\"0403\", ATTRS{idProduct}==\"6015\", SYMLINK+=\"victron\""
handlers:
- include: ../../handlers/handlers.yml
- name: restart_bt
systemd: name=bluetooth state=restarted
- name: Restart signalk-server
service: name=signalk-server state=restarted
become: true