ansible-roles/webapps/etherpad/tasks/upgrade.yml
Mathieu Gauthier-Pilote c933619b6b
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2784|0|2784|0|:zzz:
gitea/ansible-roles/pipeline/head This commit looks good
Handlers; service => systemd; shell => command
2024-05-08 15:08:28 -04:00

53 lines
1.2 KiB
YAML

---
# tasks file for etherpad upgrade
- name: Dump database to a file with compression
ansible.builtin.mysql_db:
name: "{{ service }}"
state: dump
target: "~/{{ service }}.sql.gz"
- name: Stop service
ansible.builtin.systemd:
name: "{{ service }}.service"
state: stopped
- name: Clone etherpad repo (git)
ansible.builtin.git:
repo: "{{ etherpad_git_url }}"
dest: "~/etherpad-lite/"
version: "{{ etherpad_git_version }}"
update: yes
force: true
become_user: "{{ service }}"
- name: Fix run.sh so it does not start etherpad at the end
ansible.builtin.lineinfile:
path: "~/etherpad-lite/src/bin/run.sh"
state: absent
regexp: 'exec node src/node/server.js'
become_user: "{{ service }}"
- name: Run setup
ansible.builtin.shell: "src/bin/run.sh"
args:
chdir: "~/etherpad-lite"
become_user: "{{ service }}"
- name: Start service
ansible.builtin.systemd:
name: "{{ service }}.service"
state: started
- name: Define variable to skip next task by default
ansible.builtin.set_fact:
keep_db_dump: true
- name: Remove database dump
ansible.builtin.file:
path: "~/{{ service }}.sql.gz"
state: absent
when: keep_db_dump is undefined
tags: clean
notify: reload nginx