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

starting gitea if backup failed

Resolving https://github.com/roles-ansible/ansible_role_gitea/issues/78
This commit is contained in:
L3D 2022-05-04 20:42:23 +02:00
parent 2f0a24f4f1
commit 129674be94
Signed by: l3d
GPG key ID: CD08445BFF4313D1
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" cmd: "sudo -u {{ gitea_user }} /usr/local/bin/gitea dump -c /etc/gitea/gitea.ini"
chdir: "{{ gitea_backup_location }}" chdir: "{{ gitea_backup_location }}"
changed_when: true 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: when:
- ansible_facts.services["gitea.service"] is defined - ansible_facts.services["gitea.service"] is defined
- ansible_facts.services["gitea.service"].state == "running" - ansible_facts.services["gitea.service"].state == "running"

View file

@ -56,5 +56,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl' - 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/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' playbook_version_path: 'do1jlr.gitea.version'