1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

Merge pull request #79 from roles-ansible/rescue

starting gitea if backup failed
This commit is contained in:
L3D 2022-05-04 20:44:38 +02:00 committed by GitHub
commit 673b662431
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -27,6 +27,17 @@
cmd: "sudo -u {{ gitea_user }} /usr/local/bin/gitea dump -c /etc/gitea/gitea.ini"
chdir: "{{ gitea_backup_location }}"
changed_when: true
rescue:
- name: Starting gitea because backup failed
become: true
ansible.builtin.systemd:
name: gitea
state: stopped
when: ansible_service_mgr == "systemd"
- name: print updateing error
ansible.builtin.debug:
msg: "failed to backup gitea"
when:
- ansible_facts.services["gitea.service"] is defined
- ansible_facts.services["gitea.service"].state == "running"

View file

@ -56,5 +56,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 36 # should be int
playbook_version_number: 37 # should be int
playbook_version_path: 'do1jlr.gitea.version'