From 0a19c928f51672b9100c7b93b148b420bdaf3647 Mon Sep 17 00:00:00 2001 From: Christoph Date: Fri, 31 Jul 2026 02:56:14 +0200 Subject: [PATCH] Add checks for defined return codes in samba user management tasks --- roles/common/tasks/samba-remove-user.yml | 2 ++ roles/common/tasks/samba-user.yml | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/common/tasks/samba-remove-user.yml b/roles/common/tasks/samba-remove-user.yml index 9ac95cc..ef83c32 100644 --- a/roles/common/tasks/samba-remove-user.yml +++ b/roles/common/tasks/samba-remove-user.yml @@ -30,6 +30,7 @@ loop_control: label: '{{ item.item.name }}' when: + - item.rc is defined - item.rc == 0 tags: - samba-user @@ -60,6 +61,7 @@ loop_control: label: '{{ item.item.name }}' when: + - item.rc is defined - item.rc == 0 tags: - samba-user diff --git a/roles/common/tasks/samba-user.yml b/roles/common/tasks/samba-user.yml index b42d1e6..3bccda3 100644 --- a/roles/common/tasks/samba-user.yml +++ b/roles/common/tasks/samba-user.yml @@ -30,7 +30,9 @@ executable: /bin/bash changed_when: true loop: "{{ common_samba_nis_user_present.results }}" - when: item.rc == 1 + when: + - item.rc is defined + - item.rc == 1 loop_control: label: '{{ item.item.name }}' tags: