feat: make mcaptcha systemd service wait on deps

This commit is contained in:
Aravinth Manivannan 2023-12-12 23:52:43 +05:30
parent 7e9f0a3633
commit 1c17a3f3d9
Signed by: realaravinth
GPG key ID: F8F50389936984FF
2 changed files with 19 additions and 14 deletions

View file

@ -42,9 +42,9 @@
- name: Copy mCaptcha systemd servicefile - name: Copy mCaptcha systemd servicefile
become: true become: true
ansible.builtin.copy: ansible.builtin.template:
src: ./artifacts/mcaptcha/mcaptcha.service src: ./templates/mcaptcha/mcaptcha.service.j2
dest: /etc/systemd/system/ dest: /etc/systemd/system/mcaptcha.service
owner: root owner: root
group: root group: root
force: true force: true
@ -57,7 +57,7 @@
state: directory state: directory
mode: "0755" mode: "0755"
- name: Copy mCaptcha systemd servicefile - name: Copy mCaptcha config file
become: true become: true
notify: restart mcaptcha notify: restart mcaptcha
ansible.builtin.template: ansible.builtin.template:

View file

@ -2,18 +2,23 @@
Description=mCaptcha: PoW CAPTCHA system Description=mCaptcha: PoW CAPTCHA system
After=syslog.target After=syslog.target
After=network.target After=network.target
###
# Don't forget to add the database service dependencies {% if cache_type == 'redis' %}
### Wants=redis.service
# After=redis.service
#Wants=mariadb.service {% endif %}
#After=mariadb.service
# {% if database_type == 'postgres' %}
Wants=postgresql.service Wants=postgresql.service
After=postgresql.service After=postgresql.service
# {% endif %}
#Wants=redis.service
#After=redis.service {% if database_type == 'mariadb' %}
Wants=mariadb.service
After=mariadb.service
{% endif %}
[Service] [Service]
RestartSec=2s RestartSec=2s