mqtt: Bridge the bambulab printer

This commit is contained in:
polyfloyd 2024-07-14 14:54:58 +02:00
parent 4e75346365
commit 3ae4b05e17
6 changed files with 21 additions and 3 deletions

View file

@ -1,6 +1,6 @@
--- ---
- hosts: mqtt_internal - hosts: mqtt
roles: roles:
- common - common
- mqtt-internal - mqtt-internal

View file

@ -0,0 +1 @@
mqtt_bambulab_cafile: /etc/mosquitto/ca_certificates/bambulab.pem

View file

@ -8,6 +8,12 @@
- mosquitto - mosquitto
- avahi-daemon - avahi-daemon
- name: Install bambulab cafile
# openssl s_client -showcerts -connect <ip>:8883 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p'
ansible.builtin.copy:
dest: "{{ mqtt_bambulab_cafile }}"
content: "{{ lookup('passwordstore', 'bambulab subkey=cafile') }}"
- name: Configure Mosquitto - name: Configure Mosquitto
ansible.builtin.template: ansible.builtin.template:
src: "{{ item }}" src: "{{ item }}"
@ -17,6 +23,7 @@
mode: 0644 mode: 0644
notify: restart mosquitto notify: restart mosquitto
with_items: with_items:
- bambulab.conf
- internal.conf - internal.conf
- public-bridge.conf - public-bridge.conf

View file

@ -0,0 +1,10 @@
# {{ ansible_managed }}
connection bambulab
address {{ lookup('passwordstore', 'bambulab subkey=host') }}:8883
bridge_cafile {{ mqtt_bambulab_cafile }}
bridge_insecure true
remote_username bblp
remote_password {{ lookup('passwordstore', 'bambulab subkey=key') }}
topic # in 2 bambulab/ ""

View file

@ -1,4 +1,4 @@
# Managed by Ansible # {{ ansible_managed }}
listener 1883 :: listener 1883 ::
listener 1883 0.0.0.0 listener 1883 0.0.0.0

View file

@ -1,4 +1,4 @@
# Managed by Ansible # {{ ansible_managed }}
connection public-bridge connection public-bridge
address {{ mqtt_public_host }} address {{ mqtt_public_host }}