From af44ffab0ade11a5b1feda998dcf4c241a6bccb5 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 27 Dec 2023 14:39:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B5=84=E4=BA=A7=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=B5=84=E4=BA=A7=E8=B4=A6=E5=8F=B7=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8A=A5=E9=94=99=20(#12437)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/automations/remove_account/host/posix/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/accounts/automations/remove_account/host/posix/main.yml b/apps/accounts/automations/remove_account/host/posix/main.yml index de91b8552..cddac5541 100644 --- a/apps/accounts/automations/remove_account/host/posix/main.yml +++ b/apps/accounts/automations/remove_account/host/posix/main.yml @@ -16,10 +16,11 @@ - name: "Rename user home directory if it exists" ansible.builtin.command: cmd: "mv {{ user_home_dir.stdout }} {{ user_home_dir.stdout }}.bak" - when: home_dir.stat.exists and user_home_dir.stdout != "" + when: home_dir.stat | default(false) and user_home_dir.stdout != "" - name: "Remove account" ansible.builtin.user: name: "{{ account.username }}" state: absent remove: "{{ home_dir.stat.exists }}" + when: home_dir.stat | default(false)