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