fix: 资产账号不存在时 同步删除资产账号任务报错 (#12437)

Co-authored-by: feng <1304903146@qq.com>
pull/12443/head
fit2bot 11 months ago committed by GitHub
parent a09b7b29e2
commit af44ffab0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)

Loading…
Cancel
Save