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
|
- name: Install bambulab cafile
|
||||||
# openssl s_client -showcerts -connect <ip>:8883 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p'
|
# openssl s_client -showcerts -connect <ip>:8883 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p'
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: "{{ mqtt_bambulab_cafile }}"
|
dest: "/etc/mosquitto/ca_certificates/bambu_{{ item.name }}.pem"
|
||||||
content: "{{ lookup('passwordstore', 'bambulab subkey=cafile') }}"
|
content: "{{ item.cafile }}"
|
||||||
|
notify: restart mosquitto
|
||||||
|
with_items: "{{ lookup('passwordstore', 'bambulab subkey=printers') }}"
|
||||||
|
|
||||||
- name: Configure Mosquitto
|
- name: Configure Mosquitto
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
|
{% for bambu in lookup('passwordstore', 'bambulab subkey=printers') %}
|
||||||
|
|
||||||
connection bambulab
|
connection bambulab_{{ bambu.name }}
|
||||||
address {{ lookup('passwordstore', 'bambulab subkey=host') }}:8883
|
address {{ bambu.host }}:8883
|
||||||
bridge_cafile {{ mqtt_bambulab_cafile }}
|
bridge_cafile /etc/mosquitto/ca_certificates/bambu_{{ bambu.name }}.pem
|
||||||
bridge_insecure true
|
bridge_insecure true
|
||||||
remote_username bblp
|
remote_username bblp
|
||||||
remote_password {{ lookup('passwordstore', 'bambulab subkey=key') }}
|
remote_password {{ bambu.key }}
|
||||||
|
topic # in 2 bambulab/{{ bambu.name }}/ ""
|
||||||
topic # in 2 bambulab/ ""
|
{% endfor %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue