remove old loop syntax
This commit is contained in:
parent
664ac5a86d
commit
a3006fe073
@ -15,23 +15,27 @@ 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:
|
||||||
|
# mosquitto_password_auth_users:
|
||||||
|
# - name: admin
|
||||||
# password: mysecret
|
# password: mysecret
|
||||||
# state: present
|
# state: present
|
||||||
# - user1:
|
# - name: user1
|
||||||
# password: very_secure
|
# password: very_secure
|
||||||
# state: absent
|
# 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:
|
||||||
|
# mosquitto_acl:
|
||||||
|
# - name: iot
|
||||||
# user: admin
|
# user: admin
|
||||||
# acl_base: topic # (topic|pattern, defaults to topic)
|
# acl_base: topic # (topic|pattern, defaults to topic)
|
||||||
# acl_topic: "#"
|
# acl_topic: "#"
|
||||||
# acl_policy: readwrite
|
# acl_policy: readwrite
|
||||||
# - readonly_iot:
|
# - name: readonly_iot
|
||||||
# user: user1
|
# user: user1
|
||||||
# acl_base: topic
|
# acl_base: topic
|
||||||
# acl_topic: my/devices
|
# acl_topic: my/devices
|
||||||
|
@ -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