--- - name: Store acl file for user template: src: user.acl dest: "{{ environment_directory }}/{{ user }}.acl" owner: root group: root mode: "u=rw,g=r,o=r" notify: reconfigure mosquitto acl - name: Store auth file for user command: >- mosquitto_passwd -b {{ environment_directory | quote }}/{{ user | quote }}.auth {{ user | quote }} {{ pass | quote }} notify: reconfigure mosquitto auth