feat: add check for /mnt/services directory existence before cleaning
Some checks failed
Nix Format Check / check-format (push) Failing after 38s

This commit is contained in:
Menno van Leeuwen 2025-03-11 11:38:45 +01:00
parent e074365cc8
commit 4ac3a57411
Signed by: vleeuwenmenno
SSH Key Fingerprint: SHA256:OJFmjANpakwD3F2Rsws4GLtbdz1TJ5tkQF0RZmF0TRE

View File

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