Fix regression to backup task on first time setup.

This commit is contained in:
Brian Lee 2024-06-08 12:39:29 -07:00
parent 47407aefab
commit 2bce9c77d5

View File

@ -33,11 +33,16 @@
when: git_repository.changed
changed_when: git_repository.changed
- name: Check if strfry data path exists
ansible.builtin.stat:
path: "{{ strfry_data_path }}"
register: strfry_data_path_stat
- name: Backup existing strfry-db
ansible.builtin.shell:
cmd: strfry export > backup.jsonl
chdir: "{{ strfry_binary_path }}"
chdir: "{{ strfry_data_path }}"
become: yes
become_user: "{{ strfry_system_user }}"
when: git_repository.changed
when: git_repository.changed and strfry_data_path_stat.stat.exists
changed_when: git_repository.changed