36 lines
942 B
YAML
36 lines
942 B
YAML
---
|
|
|
|
- name: Mosquitto | Install Mosquitto packages
|
|
ansible.builtin.apt:
|
|
name: "{{ item }}"
|
|
state: present
|
|
with_items: "{{ mosquitto_packages }}"
|
|
notify: Restart Mosquitto
|
|
|
|
- name: Mosquitto | Generating Configuration File
|
|
ansible.builtin.template:
|
|
src: mosquitto.conf.j2
|
|
dest: /etc/mosquitto/conf.d/mosquitto.conf
|
|
mode: "0755"
|
|
notify: Restart Mosquitto
|
|
|
|
- name: Mosquitto | Generating Authentication Users File
|
|
ansible.builtin.template:
|
|
src: users.j2
|
|
dest: "/etc/mosquitto/users_{{ item.name }}"
|
|
mode: "0755"
|
|
vars:
|
|
mosquitto_users: "{{ item.users }}"
|
|
with_items: "{{ mosquitto_listeners }}"
|
|
notify: Restart Mosquitto
|
|
|
|
- name: Mosquitto | Generating Access Control List File
|
|
ansible.builtin.template:
|
|
src: acl.j2
|
|
dest: "/etc/mosquitto/acl_{{ item.name }}"
|
|
mode: "0755"
|
|
vars:
|
|
listener: "{{ item }}"
|
|
with_items: "{{ mosquitto_listeners }}"
|
|
notify: Restart Mosquitto
|