From 78de59fbfe92e61630afc0fed1a8195ad23956a1 Mon Sep 17 00:00:00 2001 From: Morre Date: Fri, 2 Oct 2020 15:11:28 +0200 Subject: [PATCH] update cache before using groups --- tasks/groupfolders.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tasks/groupfolders.yml b/tasks/groupfolders.yml index bc81857..7e8eb1b 100644 --- a/tasks/groupfolders.yml +++ b/tasks/groupfolders.yml @@ -47,6 +47,13 @@ search_key: "mount_point" search_val: "{{ item.name }}" + # We search for some random name so that the LDAP data cache gets updated + - name: update LDAP cache + command: "/usr/bin/php occ ldap:search random_string_to_update_cache" + args: + chdir: /var/www/nextcloud + changed_when: False + # Set folder permissions if they are not correct yet - name: Set folder permissions command: "/usr/bin/php occ groupfolders:group {{ (group_folders | selectattr(search_key, 'equalto', search_val) | list | first).id }} {{ item.1 }} write share delete"