forked from bitlair/ansible
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: "2a02:166b:92::/64" }
|
||||
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
|
||||
|
||||
connection public-bridge
|
||||
address {{ mqtt_internal_public_host }}
|
||||
address {{ mqtt_public_host }}
|
||||
|
||||
topic bitlair/state out
|
||||
topic bitlair/state/djo out
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
loglevel: INFO
|
||||
|
||||
mqtt:
|
||||
host: mqtt.bitlair.nl
|
||||
host: {{ mqtt_internal_host }}
|
||||
|
||||
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_path: /opt/wip
|
||||
|
|
|
@ -10,7 +10,7 @@ Restart=on-failure
|
|||
RestartSec=10s
|
||||
ExecStart=/var/lib/discord-bot/.venv/bin/python /var/lib/discord-bot/main.py
|
||||
DynamicUser=true
|
||||
Environment="MQTT_HOST=bitlair.nl"
|
||||
Environment="MQTT_HOST={{ mqtt_internal_host }}"
|
||||
Environment="DISCORD_WEBHOOK_URL={{ discord_webhook_url }}"
|
||||
Environment="DISCORD_TOKEN={{ discord_token }}"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
set -eu
|
||||
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
|
||||
path=$(echo $event | cut -d ' ' -f 2)
|
||||
url="https://bitlair.nl/fotos/view/$path"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
mqtt_server = 'mqtt.bitlair.nl'
|
||||
mqtt_server = '{{ mqtt_internal_host }}'
|
||||
mqtt_port = 1883
|
||||
|
||||
spacestate_topic = 'bitlair/state'
|
||||
|
|
Loading…
Add table
Reference in a new issue