remove old loop syntax
This commit is contained in:
parent
664ac5a86d
commit
a3006fe073
@ -15,27 +15,31 @@ mosquitto_iptables_enabled: False
|
|||||||
|
|
||||||
mosquitto_password_auth_enabled: False
|
mosquitto_password_auth_enabled: False
|
||||||
mosquitto_password_auth_file: "{{ mosquitto_base_dir }}/passwd"
|
mosquitto_password_auth_file: "{{ mosquitto_base_dir }}/passwd"
|
||||||
# mosquitto_password_auth_users: (defaults to not set)
|
mosquitto_password_auth_users: []
|
||||||
# - admin:
|
## Example:
|
||||||
# password: mysecret
|
# mosquitto_password_auth_users:
|
||||||
# state: present
|
# - name: admin
|
||||||
# - user1:
|
# password: mysecret
|
||||||
# password: very_secure
|
# state: present
|
||||||
# state: absent
|
# - name: user1
|
||||||
|
# password: very_secure
|
||||||
|
# state: absent
|
||||||
|
|
||||||
mosquitto_acl_enabled: False
|
mosquitto_acl_enabled: False
|
||||||
mosquitto_acl_file: "{{ mosquitto_base_dir }}/aclfile"
|
mosquitto_acl_file: "{{ mosquitto_base_dir }}/aclfile"
|
||||||
# mosquitto_acl: (defaults to not set)
|
mosquitto_acl: []
|
||||||
# - iot:
|
## Example:
|
||||||
# user: admin
|
# mosquitto_acl:
|
||||||
# acl_base: topic # (topic|pattern, defaults to topic)
|
# - name: iot
|
||||||
# acl_topic: "#"
|
# user: admin
|
||||||
# acl_policy: readwrite
|
# acl_base: topic # (topic|pattern, defaults to topic)
|
||||||
# - readonly_iot:
|
# acl_topic: "#"
|
||||||
# user: user1
|
# acl_policy: readwrite
|
||||||
# acl_base: topic
|
# - name: readonly_iot
|
||||||
# acl_topic: my/devices
|
# user: user1
|
||||||
# acl_policy: readwrite
|
# acl_base: topic
|
||||||
|
# acl_topic: my/devices
|
||||||
|
# acl_policy: readwrite
|
||||||
|
|
||||||
mosquitto_tls_enabled: False
|
mosquitto_tls_enabled: False
|
||||||
mosquitto_tls_ciphers:
|
mosquitto_tls_ciphers:
|
||||||
|
@ -18,15 +18,19 @@
|
|||||||
# TODO: ugly workaround, move this to a custom module
|
# TODO: ugly workaround, move this to a custom module
|
||||||
- block:
|
- block:
|
||||||
- name: Add users to password file
|
- name: Add users to password file
|
||||||
shell: "mosquitto_passwd -b {{ mosquitto_password_auth_file }} {{ item.key }} {{ item.value.password }}"
|
shell: "mosquitto_passwd -b {{ mosquitto_password_auth_file }} {{ item.name }} {{ item.password }}"
|
||||||
with_dict: "{{ mosquitto_password_auth_users | default('{}') }}"
|
loop: "{{ mosquitto_password_auth_users }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
when: item.value.state == "present"
|
when: item.value.state == "present"
|
||||||
changed_when: False
|
changed_when: False
|
||||||
no_log: True
|
no_log: True
|
||||||
|
|
||||||
- name: Remove unnecessary users from password file
|
- name: Remove unnecessary users from password file
|
||||||
shell: "mosquitto_passwd -D {{ mosquitto_password_auth_file }} {{ item.key }}"
|
shell: "mosquitto_passwd -D {{ mosquitto_password_auth_file }} {{ item.name }}"
|
||||||
with_dict: "{{ mosquitto_password_auth_users | default('{}') }}"
|
loop: "{{ mosquitto_password_auth_users }}"
|
||||||
|
loop_control:
|
||||||
|
label: "{{ item.name }}"
|
||||||
when: item.value.state == "absent"
|
when: item.value.state == "absent"
|
||||||
changed_when: False
|
changed_when: False
|
||||||
no_log: True
|
no_log: True
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
recurse: True
|
recurse: True
|
||||||
with_items:
|
loop:
|
||||||
- "{{ mosquitto_tls_cert_path | dirname }}"
|
- "{{ mosquitto_tls_cert_path | dirname }}"
|
||||||
- "{{ mosquitto_tls_key_path | dirname }}"
|
- "{{ mosquitto_tls_key_path | dirname }}"
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
loop:
|
||||||
- { src: "{{ mosquitto_tls_key_source }}", dest: '{{ mosquitto_tls_key_path }}', mode: '0600' }
|
- { src: "{{ mosquitto_tls_key_source }}", dest: '{{ mosquitto_tls_key_path }}', mode: '0600' }
|
||||||
- { src: "{{ mosquitto_tls_cert_source }}", dest: '{{ mosquitto_tls_cert_path }}', mode: '0750' }
|
- { src: "{{ mosquitto_tls_cert_source }}", dest: '{{ mosquitto_tls_cert_path }}', mode: '0750' }
|
||||||
loop_control:
|
loop_control:
|
||||||
|
Loading…
Reference in New Issue
Block a user