Compare commits
No commits in common. "371699778310b6feedd5b6908c9de6251efd2661" and "7eea8662da2171e18807049362110a69a25a2160" have entirely different histories.
3716997783
...
7eea8662da
8 changed files with 0 additions and 140 deletions
|
@ -13,12 +13,6 @@
|
|||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: restart irc-doorduino
|
||||
systemd:
|
||||
name: irc-doorduino
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: restart discord-bot
|
||||
systemd:
|
||||
name: discord-bot
|
||||
|
@ -42,9 +36,3 @@
|
|||
name: mastodon-spacestate
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
||||
- name: restart mqtt-graphite
|
||||
systemd:
|
||||
name: mqtt-graphite
|
||||
state: restarted
|
||||
daemon_reload: true
|
||||
|
|
|
@ -58,28 +58,3 @@
|
|||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: true
|
||||
|
||||
- name: Install doorduino notification
|
||||
template:
|
||||
src: irc-doorduino.sh
|
||||
dest: /var/lib/irc-helpers/doorduino.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify: restart irc-doorduino
|
||||
|
||||
- name: Install doorduino notification service
|
||||
template:
|
||||
src: irc-doorduino.service
|
||||
dest: /etc/systemd/system/irc-doorduino.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart irc-doorduino
|
||||
|
||||
- name: Start irc-doorduino
|
||||
systemd:
|
||||
name: irc-doorduino
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: true
|
||||
|
|
|
@ -13,6 +13,3 @@
|
|||
|
||||
- tags: services_mastodon_spacestate
|
||||
import_tasks: mastodon_spacestate.yaml
|
||||
|
||||
- tags: services_mqtt_graphite
|
||||
import_tasks: mqtt_graphite.yaml
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
- name: Install mqtt-graphite
|
||||
template:
|
||||
src: mqtt-graphite.sh
|
||||
dest: /var/lib/mqtt-graphite.sh
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0755
|
||||
notify: restart mqtt-graphite
|
||||
|
||||
- name: Install mqtt-graphite service
|
||||
template:
|
||||
src: mqtt-graphite.service
|
||||
dest: /etc/systemd/system/mqtt-graphite.service
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart mqtt-graphite
|
||||
|
||||
- name: Start mqtt-graphite
|
||||
systemd:
|
||||
name: mqtt-graphite
|
||||
state: started
|
||||
enabled: yes
|
||||
daemon_reload: true
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# Managed by Ansible
|
||||
|
||||
[Unit]
|
||||
Description=Bitlair IRC doorduino notification
|
||||
After=network.target
|
||||
Requires=irc-bot.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/bin/bash /var/lib/irc-helpers/doorduino.sh
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
DynamicUser=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,24 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Managed by Ansible
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
initial=1
|
||||
|
||||
mqtt-simple -h {{ mqtt_internal_host }} -t "bitlair/doorduino/+" |
|
||||
while read line; do
|
||||
topic=$(echo "$line" | cut -d' ' -f1 | sed "s/bitlair\/doorduino\///")
|
||||
value=$(echo "$line" | cut -s -d' ' -f2-)
|
||||
|
||||
if [ $initial == 0 ] && [ $value != 0 ]; then
|
||||
if [ $topic == "doorbell" ]; then
|
||||
irc-say "DEURBEL! Open de deur beneden!"
|
||||
elif [ $topic != "dooropen" ]; then
|
||||
irc-say "Doorduino: $topic $value"
|
||||
fi
|
||||
fi
|
||||
initial=0
|
||||
done
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
# Managed by Ansible
|
||||
|
||||
[Unit]
|
||||
Description=MQTT to Graphite bridge
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/bin/bash /var/lib/mqtt-graphite.sh
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
DynamicUser=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -1,20 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
GRAPHITE_HOST="100.64.0.11"
|
||||
GRAPHITE_PORT="2003"
|
||||
|
||||
set -eu
|
||||
set -o pipefail
|
||||
|
||||
mqtt-simple -h {{ mqtt_internal_host }} -t "#" |
|
||||
while read line; do
|
||||
topic=$(echo "$line" | cut -d' ' -f1 | sed 's/\//./g' | tr '[:upper:]' '[:lower:]')
|
||||
value=$(echo "$line" | cut -s -d' ' -f2- | sed 's/closed/0/g;s/open/1/g')
|
||||
|
||||
# Only relay numeric values.
|
||||
if [[ $value =~ ^-?[0-9]+\.?[0-9]*$ ]]; then
|
||||
echo "$topic $value $(date +%s)" | nc -q0 "$GRAPHITE_HOST" "$GRAPHITE_PORT"
|
||||
echo "$topic $value $(date +%s)"
|
||||
fi
|
||||
done
|
||||
|
Loading…
Add table
Reference in a new issue