mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-06-22 21:17:30 +00:00
fix: 资产账号不存在时 同步删除资产账号任务报错 (#12437)
Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
parent
a09b7b29e2
commit
af44ffab0a
@ -16,10 +16,11 @@
|
|||||||
- name: "Rename user home directory if it exists"
|
- name: "Rename user home directory if it exists"
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
cmd: "mv {{ user_home_dir.stdout }} {{ user_home_dir.stdout }}.bak"
|
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"
|
- name: "Remove account"
|
||||||
ansible.builtin.user:
|
ansible.builtin.user:
|
||||||
name: "{{ account.username }}"
|
name: "{{ account.username }}"
|
||||||
state: absent
|
state: absent
|
||||||
remove: "{{ home_dir.stat.exists }}"
|
remove: "{{ home_dir.stat.exists }}"
|
||||||
|
when: home_dir.stat | default(false)
|
||||||
|
Loading…
Reference in New Issue
Block a user