mqtt: Bridge the bambulab printer
This commit is contained in:
parent
4e75346365
commit
3ae4b05e17
6 changed files with 21 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- hosts: mqtt_internal
|
- hosts: mqtt
|
||||||
roles:
|
roles:
|
||||||
- common
|
- common
|
||||||
- mqtt-internal
|
- mqtt-internal
|
||||||
|
|
1
roles/mqtt-internal/defaults/main.yaml
Normal file
1
roles/mqtt-internal/defaults/main.yaml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
mqtt_bambulab_cafile: /etc/mosquitto/ca_certificates/bambulab.pem
|
|
@ -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
|
||||||
|
|
||||||
|
|
10
roles/mqtt-internal/templates/bambulab.conf
Normal file
10
roles/mqtt-internal/templates/bambulab.conf
Normal 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/ ""
|
|
@ -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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Managed by Ansible
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
connection public-bridge
|
connection public-bridge
|
||||||
address {{ mqtt_public_host }}
|
address {{ mqtt_public_host }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue