Add Ansible config for mqtt.bitlair.nl

This commit is contained in:
polyfloyd 2021-05-24 15:26:09 +02:00
parent 4472319574
commit fbd31bfd3d
7 changed files with 62 additions and 0 deletions

View file

@ -1,2 +1,3 @@
ansible_user: root
ansible_python_interpreter: auto_silent
notify_email: bestuur@bitlair.nl

3
hosts
View file

@ -1,2 +1,5 @@
[bar]
bank-pi.bitlair.nl
[mqtt_internal]
mqtt.bitlair.nl

7
mqtt-internal.yaml Normal file
View file

@ -0,0 +1,7 @@
---
- hosts: mqtt_internal
vars:
mqtt_internal_public_host: bitlair.nl
roles:
- polyfloyd.tweaks
- mqtt-internal

4
requirements.yaml Normal file
View file

@ -0,0 +1,4 @@
---
- name: polyfloyd.tweaks
src: gitea@git.polyfloyd.net:polyfloyd/ansible-tweaks.git
scm: git

View file

@ -0,0 +1,5 @@
---
- name: restart_mosquitto
systemd:
name: mosquitto
state: restarted

View 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

View 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