From f26accad1f8292b9e9c1cd470a1496958a905b7e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <Joerg.Sachse@slub-dresden.de>
Date: Tue, 9 Aug 2022 11:01:11 +0200
Subject: [PATCH] fix: loop syntax

---
 tasks/configure_home_permissions.yml | 30 +++++++++++++---------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/tasks/configure_home_permissions.yml b/tasks/configure_home_permissions.yml
index 0343af6..9eb5167 100644
--- a/tasks/configure_home_permissions.yml
+++ b/tasks/configure_home_permissions.yml
@@ -1,17 +1,15 @@
 ---
-- name: $HOME-Verzeichnisse von Usern mit gleichen Gruppen schützen
-  block:
-    - name: $HOME-Verzeichnisse sammeln
-      ansible.builtin.find:
-        file_type: directory
-        paths: "/home/"
-        excludes: 'import'
-      register: ls_out
-    - name: striktere Berechtigungen für Homeverzeichnisse setzen
-      ansible.builtin.file:
-        path: "{{ item.path }}/"
-        mode: "0700"
-      loop:
-        # - "{{ ls_out.files | difference(['import','zih']) }}"
-        - "{{ ls_out.files }}"
-      when: item.path not in "import"
+- name: assemble a list of all $HOME directories
+  ansible.builtin.find:
+    file_type: directory
+    paths: "/home/"
+    excludes: 'import'
+  register: ls_out
+
+- name: set stricter permissions to protect $HOME directories from access by users with the same group
+  ansible.builtin.file:
+    path: "{{ item.path }}/"
+    mode: "0700"
+  loop: "{{ ls_out.files }}"
+  # loop: "{{ ls_out.files | difference(['import','zih']) }}"
+  when: not "import" in item.path
-- 
GitLab