From 504b0c6b87f827fb824232f3d686d940c3d5174a Mon Sep 17 00:00:00 2001 From: Andrew Shu Date: Sat, 9 Nov 2024 21:48:58 -0800 Subject: [PATCH] ansible: add fallback for gunicorn_reloader.path service --- ansible/roles/gunicorn/tasks/main.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/ansible/roles/gunicorn/tasks/main.yml b/ansible/roles/gunicorn/tasks/main.yml index d541fde..30fe9c8 100644 --- a/ansible/roles/gunicorn/tasks/main.yml +++ b/ansible/roles/gunicorn/tasks/main.yml @@ -47,8 +47,17 @@ group: root mode: 0644 -- name: Start and enable gunicorn_reloader path-monitoring service - service: - name: gunicorn_reloader.path - state: started - enabled: true +- name: Start and enable gunicorn_reloader path-monitoring service, with fallback + block: + - name: Start and enable gunicorn_reloader path-monitoring service + systemd_service: + name: gunicorn_reloader.path + state: started + enabled: true + rescue: + # Likely Docker; systemctl3.py doesn't support .path, so enable .service here + - name: Start and enable gunicorn.service (if .path service fails) + systemd_service: + name: gunicorn.service + state: started + enabled: true