feat: add check for /mnt/services directory existence before cleaning
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
Some checks failed
Nix Format Check / check-format (push) Failing after 38s
This commit is contained in:
parent
e074365cc8
commit
4ac3a57411
@ -19,10 +19,17 @@
|
||||
become: true
|
||||
when: mnt_services_check.rc == 0
|
||||
|
||||
- name: Check if /mnt/services directory exists
|
||||
ansible.builtin.stat:
|
||||
path: "/mnt/services"
|
||||
register: mnt_services_dir
|
||||
changed_when: false
|
||||
become: true
|
||||
|
||||
- name: Clean /mnt/services directory
|
||||
ansible.builtin.shell: find /mnt/services -mindepth 1 -maxdepth 1 -exec rm -rf {} \;
|
||||
become: true
|
||||
when: mnt_services_check.rc == 0 and not git_dir_check.stat.exists|default(false)
|
||||
when: mnt_services_check.rc == 0 and not git_dir_check.stat.exists|default(false) and mnt_services_dir.stat.exists
|
||||
|
||||
- name: Clone /mnt/services repository (initial clone)
|
||||
ansible.builtin.git:
|
||||
|
Loading…
x
Reference in New Issue
Block a user