From ed9752669e8a296aba8fb9a009c5d011bf580c3a Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 23 Mar 2024 10:27:26 +0100 Subject: [PATCH 1/2] stop lemmy before updating --- README.MD | 1 + tasks/install_server.yml | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/README.MD b/README.MD index 1c393ed..c93907d 100644 --- a/README.MD +++ b/README.MD @@ -35,6 +35,7 @@ You can use several tags when you deploy: ## CHANGELOG +- **23.03.2024** - Stop lemmy service before updating - **24.12.2023** - Add purge task - **02.12.2023** - Role update - **12.11.2022** - Role creation diff --git a/tasks/install_server.yml b/tasks/install_server.yml index 5f77304..360c6db 100644 --- a/tasks/install_server.yml +++ b/tasks/install_server.yml @@ -73,6 +73,19 @@ tags: - backend +- name: '[BACKEND] - Check if Backend systemd is active' + systemd: + name: lemmy + state: started + ignore_errors: yes + register: systemd_status + +- name: '[BACKEND] - Stop Backend systemd if it exists and is active' + systemd: + name: your_service_name + state: stopped + when: systemd_status.status == 'started' + - name: '[BACKEND] - Install Lemmy server' shell: '. /etc/profile && sudo -u {{ lemmy_username }} /home/{{ lemmy_username }}/.cargo/bin/cargo build --release' args: -- 2.30.2 From 17e7c58d6392ec8b4d3f80d510ef4301db4252a8 Mon Sep 17 00:00:00 2001 From: meaz Date: Sat, 23 Mar 2024 10:29:17 +0100 Subject: [PATCH 2/2] typo --- tasks/install_server.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/install_server.yml b/tasks/install_server.yml index 360c6db..1757ab2 100644 --- a/tasks/install_server.yml +++ b/tasks/install_server.yml @@ -82,7 +82,7 @@ - name: '[BACKEND] - Stop Backend systemd if it exists and is active' systemd: - name: your_service_name + name: lemmy state: stopped when: systemd_status.status == 'started' -- 2.30.2