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:
commit
673b662431
2 changed files with 12 additions and 1 deletions
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue