-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwendelin-olimex-iot-gateway.yml
41 lines (28 loc) · 1.27 KB
/
wendelin-olimex-iot-gateway.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
# Playbook to prepare Olimex board to act as a IoT Gateway
# which sends data to a Wendelin instance
- import_playbook: wendelin-olimex-base.yml
- name: a play that runs entirely on the ansible host
hosts: 127.0.0.1
connection: local
vars:
- iptables_rules: |
# We send data to Wendelin via HTTP or HTTPS
# Only accept packets on the INPUT chain that are ESTABLISHED or RELATED to a current connection
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# #### Output exceptions #### #
# Accept DNS
iptables -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Accept HTTP
iptables -A OUTPUT -p tcp --dport 80 -j ACCEPT
# Accept HTTPS
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
iptables -A OUTPUT -p udp --dport 443 -j ACCEPT
# To receive data from Sensor
LISTEN_SENSOR_PORT=24224
ip6tables -A INPUT -p tcp --dport $LISTEN_SENSOR_PORT -j ACCEPT
ip6tables -A INPUT -p udp --dport $LISTEN_SENSOR_PORT -j ACCEPT
ip6tables -A OUTPUT -p tcp --sport $LISTEN_SENSOR_PORT -j ACCEPT
ip6tables -A OUTPUT -p udp --sport $LISTEN_SENSOR_PORT -j ACCEPT
roles:
- role: olimex-board