This commit is contained in:
parent
6eb35523c7
commit
c56ead77b4
3 changed files with 11 additions and 9 deletions
|
@ -1 +0,0 @@
|
|||
mqtt_bambulab_cafile: /etc/mosquitto/ca_certificates/bambulab.pem
|
|
@ -9,8 +9,10 @@
|
|||
- 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') }}"
|
||||
dest: "/etc/mosquitto/ca_certificates/bambu_{{ item.name }}.pem"
|
||||
content: "{{ item.cafile }}"
|
||||
notify: restart mosquitto
|
||||
with_items: "{{ lookup('passwordstore', 'bambulab subkey=printers') }}"
|
||||
|
||||
- name: Configure Mosquitto
|
||||
ansible.builtin.template:
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
# {{ ansible_managed }}
|
||||
{% for bambu in lookup('passwordstore', 'bambulab subkey=printers') %}
|
||||
|
||||
connection bambulab
|
||||
address {{ lookup('passwordstore', 'bambulab subkey=host') }}:8883
|
||||
bridge_cafile {{ mqtt_bambulab_cafile }}
|
||||
connection bambulab_{{ bambu.name }}
|
||||
address {{ bambu.host }}:8883
|
||||
bridge_cafile /etc/mosquitto/ca_certificates/bambu_{{ bambu.name }}.pem
|
||||
bridge_insecure true
|
||||
remote_username bblp
|
||||
remote_password {{ lookup('passwordstore', 'bambulab subkey=key') }}
|
||||
|
||||
topic # in 2 bambulab/ ""
|
||||
remote_password {{ bambu.key }}
|
||||
topic # in 2 bambulab/{{ bambu.name }}/ ""
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue