mirror of
https://github.com/roles-ansible/ansible_role_gitea.git
synced 2024-08-16 11:39:50 +02:00
L3D
9f55d0eefd
since it is possible to run gitea with an other user defined in the ``{{ gitea_user }}`` variable, I built it in this command.
32 lines
951 B
YAML
32 lines
951 B
YAML
---
|
|
- name: Get service facts
|
|
ansible.builtin.service_facts:
|
|
|
|
- block:
|
|
- name: Stopping gitea before upgrade
|
|
become: true
|
|
ansible.builtin.systemd:
|
|
name: gitea
|
|
state: stopped
|
|
when: ansible_service_mgr == "systemd"
|
|
|
|
- name: "Create backup directory"
|
|
become: true
|
|
ansible.builtin.file:
|
|
path: "{{ item }}"
|
|
state: directory
|
|
owner: "{{ gitea_user }}"
|
|
group: "{{ gitea_group }}"
|
|
mode: 'u=rwx,g=rx,o='
|
|
with_items:
|
|
- "{{ gitea_backup_location }}"
|
|
|
|
- name: Backing up gitea before upgrade
|
|
become: true
|
|
ansible.builtin.command:
|
|
cmd: "sudo -u {{ gitea_user }} 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"
|
|
- gitea_active_version.stdout != gitea_version_target
|