try to fix acl template

This commit is contained in:
Robert Kaussow 2018-11-07 22:00:41 +01:00
parent dcdcac728a
commit f45db7d27e
2 changed files with 5 additions and 6 deletions

View File

@ -38,9 +38,8 @@
owner: root
group: root
mode: 0600
with_dict: "{{ mosquitto_password_auth_users | default('{}') }}"
when:
- mosquitto_acl_enabled
- mosquitto_acl
- mosquitto_acl is defined
become: True
become_user: root

View File

@ -1,8 +1,8 @@
# {{ ansible_managed }}
{% for acl in mosquitto_acl %}
{% if not acl.user == "all" %}
{{ acl.user }}
{% for item in mosquitto_acl.values() %}
{% if not item.user == "all" %}
{{ item.user }}
{% endif %}
{{ acl.acl_base if acl.acl_base is defined else 'topic' }} {{ acl.acl_policy }} {{ acl.acl_topic }}
{{ item.acl_base if item.acl_base is defined else 'topic' }} {{ item.acl_policy }} {{ item.acl_topic }}
{% endfor %}