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

View file

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