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: