cast inventory values to int, fixes comparison and speeds up ansible runs

This commit is contained in:
psy 2024-02-16 19:33:50 +01:00
parent a021ef5919
commit eb37e03c76
No known key found for this signature in database
GPG key ID: 30546501FF65B1A5

View file

@ -31,9 +31,9 @@
# Set quota for folders where it does not match
- name: set group folder quota
command: "nextcloud-occ groupfolders:quota {{ (group_folders | selectattr(search_key, 'equalto', search_val) | list | first).id }} {{ item.quota }}"
command: "nextcloud-occ groupfolders:quota {{ (group_folders | selectattr(search_key, 'equalto', search_val) | list | first).id }} {{ item.quota | int }}"
with_items: "{{ nextcloud.groupfolders }}"
when: (group_folders | selectattr(search_key, 'equalto', search_val) | list | first).quota != item.quota
when: (group_folders | selectattr(search_key, 'equalto', search_val) | list | first).quota != item.quota | int
vars:
search_key: "mount_point"
search_val: "{{ item.name }}"