From eb37e03c76e68aa2be99b07f2bd5a99f02c1850c Mon Sep 17 00:00:00 2001 From: psy Date: Fri, 16 Feb 2024 19:33:50 +0100 Subject: [PATCH] cast inventory values to int, fixes comparison and speeds up ansible runs --- tasks/groupfolders.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/groupfolders.yml b/tasks/groupfolders.yml index eb0228c..46dd525 100644 --- a/tasks/groupfolders.yml +++ b/tasks/groupfolders.yml @@ -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 }}"