diff --git a/tasks/backup.yml b/tasks/backup.yml index 93c67f9..a876e9b 100644 --- a/tasks/backup.yml +++ b/tasks/backup.yml @@ -22,11 +22,11 @@ - "{{ gitea_backup_location }}" - name: Backing up gitea before upgrade - ansible.builtin.command: - cmd: "gitea dump -c /etc/gitea/gitea.ini" - chdir: "{{ gitea_backup_location }}" become: true - become_user: "{{ gitea_user }}" + ansible.builtin.command: + cmd: "sudo -u gitea gitea dump -c /etc/gitea/gitea.ini" + chdir: "{{ gitea_backup_location }}" + when: - ansible_facts.services["gitea.service"] is defined - ansible_facts.services["gitea.service"].state == "running"