Add Ansible config for mqtt.bitlair.nl
This commit is contained in:
parent
4472319574
commit
fbd31bfd3d
7 changed files with 62 additions and 0 deletions
5
roles/mqtt-internal/handlers/main.yaml
Normal file
5
roles/mqtt-internal/handlers/main.yaml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
- name: restart_mosquitto
|
||||
systemd:
|
||||
name: mosquitto
|
||||
state: restarted
|
22
roles/mqtt-internal/tasks/main.yaml
Normal file
22
roles/mqtt-internal/tasks/main.yaml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
- name: mqtt-internal
|
||||
tags: mqtt_internal
|
||||
block:
|
||||
- name: Install broker
|
||||
apt:
|
||||
name: mosquitto
|
||||
|
||||
- name: Configure public bridge forwarding
|
||||
template:
|
||||
src: public-bridge.conf
|
||||
dest: /etc/mosquitto/conf.d/public-bridge.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: restart_mosquitto
|
||||
|
||||
- name: Start mosquitto
|
||||
systemd:
|
||||
name: mosquitto
|
||||
state: started
|
||||
enabled: yes
|
20
roles/mqtt-internal/templates/public-bridge.conf
Normal file
20
roles/mqtt-internal/templates/public-bridge.conf
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Managed by Ansible
|
||||
|
||||
connection public-bridge
|
||||
|
||||
address {{ mqtt_internal_public_host }}
|
||||
|
||||
topic bitlair/test/+ out
|
||||
topic bitlair/debug/+ out
|
||||
topic bitlair/state out
|
||||
topic bitlair/state/djo out
|
||||
topic bitlair/cam/+ out
|
||||
topic bitlair/music/+/state out
|
||||
topic bitlair/music/+/volume out
|
||||
topic bitlair/wifi/+/online out
|
||||
topic bitlair/climate/+ out
|
||||
topic bitlair/temperature/+/current out
|
||||
topic bitlair/temperature/+/target out
|
||||
topic bitlair/humidity/+ out
|
||||
topic bitlair/lasercutter/+ out
|
||||
topic bitlair/flash out
|
Loading…
Add table
Add a link
Reference in a new issue