Use global config for MQTT hosts
This commit is contained in:
parent
1a26f81be6
commit
fd6cc59b48
8 changed files with 9 additions and 7 deletions
|
@ -13,3 +13,6 @@ trusted_ranges:
|
||||||
- { v: ipv6, cidr: "fe80::/10" }
|
- { v: ipv6, cidr: "fe80::/10" }
|
||||||
- { v: ipv6, cidr: "2a02:166b:92::/64" }
|
- { v: ipv6, cidr: "2a02:166b:92::/64" }
|
||||||
node_exporter: no
|
node_exporter: no
|
||||||
|
|
||||||
|
mqtt_internal_host: mqtt.bitlair.nl
|
||||||
|
mqtt_public_host: bitlair.nl
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
mqtt_internal_public_host: bitlair.nl
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Managed by Ansible
|
# Managed by Ansible
|
||||||
|
|
||||||
connection public-bridge
|
connection public-bridge
|
||||||
address {{ mqtt_internal_public_host }}
|
address {{ mqtt_public_host }}
|
||||||
|
|
||||||
topic bitlair/state out
|
topic bitlair/state out
|
||||||
topic bitlair/state/djo out
|
topic bitlair/state/djo out
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
loglevel: INFO
|
loglevel: INFO
|
||||||
|
|
||||||
mqtt:
|
mqtt:
|
||||||
host: mqtt.bitlair.nl
|
host: {{ mqtt_internal_host }}
|
||||||
|
|
||||||
sounds:
|
sounds:
|
||||||
directory: /opt/sounds
|
directory: /opt/sounds
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
photos_mqtt_host: mqtt.bitlair.nl
|
photos_mqtt_host: "{{ mqtt_internal_host }}"
|
||||||
photos_mqtt_topic: bitlair/photos
|
photos_mqtt_topic: bitlair/photos
|
||||||
photos_path: /opt/wip
|
photos_path: /opt/wip
|
||||||
|
|
|
@ -10,7 +10,7 @@ Restart=on-failure
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
ExecStart=/var/lib/discord-bot/.venv/bin/python /var/lib/discord-bot/main.py
|
ExecStart=/var/lib/discord-bot/.venv/bin/python /var/lib/discord-bot/main.py
|
||||||
DynamicUser=true
|
DynamicUser=true
|
||||||
Environment="MQTT_HOST=bitlair.nl"
|
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||||
Environment="DISCORD_WEBHOOK_URL={{ discord_webhook_url }}"
|
Environment="DISCORD_WEBHOOK_URL={{ discord_webhook_url }}"
|
||||||
Environment="DISCORD_TOKEN={{ discord_token }}"
|
Environment="DISCORD_TOKEN={{ discord_token }}"
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
set -eu
|
set -eu
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
mqtt-simple -h mqtt.bitlair.nl -s "bitlair/photos" |
|
mqtt-simple -h {{ mqtt_internal_host }} -s "bitlair/photos" |
|
||||||
while read event; do
|
while read event; do
|
||||||
path=$(echo $event | cut -d ' ' -f 2)
|
path=$(echo $event | cut -d ' ' -f 2)
|
||||||
url="https://bitlair.nl/fotos/view/$path"
|
url="https://bitlair.nl/fotos/view/$path"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
mqtt_server = 'mqtt.bitlair.nl'
|
mqtt_server = '{{ mqtt_internal_host }}'
|
||||||
mqtt_port = 1883
|
mqtt_port = 1883
|
||||||
|
|
||||||
spacestate_topic = 'bitlair/state'
|
spacestate_topic = 'bitlair/state'
|
||||||
|
|
Loading…
Add table
Reference in a new issue