2020-02-14 01:31:34 +00:00
|
|
|
- name: Disable & Stop 'kiwix-serve' systemd service
|
|
|
|
systemd:
|
|
|
|
name: kiwix-serve
|
|
|
|
enabled: no
|
|
|
|
state: stopped
|
|
|
|
|
2020-11-08 13:31:09 +00:00
|
|
|
- name: Update '{{ kiwix_library_xml }}'
|
|
|
|
command: /usr/bin/iiab-make-kiwix-lib
|
|
|
|
when: kiwix_enabled
|
|
|
|
# the above starts the service
|
|
|
|
|
|
|
|
- name: Enable & Ensure 'kiwix-serve' systemd service is started
|
|
|
|
systemd:
|
|
|
|
name: kiwix-serve
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
|
|
|
when: kiwix_enabled
|
2020-02-14 01:31:34 +00:00
|
|
|
|
|
|
|
# TO DO: BOTH CRON ENTRIES BELOW *SHOULD* BE DELETED "when: not kiwix_enabled"
|
|
|
|
|
|
|
|
# In the past kiwix-serve did not stay running, so we'd been doing this hourly.
|
|
|
|
# @mgautierfr & others suggest kiwix-serve might be auto-restarted w/o cron in
|
|
|
|
# future, whenever service fails, if this really catches all cases??
|
|
|
|
# https://github.com/iiab/iiab/issues/484#issuecomment-342151726
|
|
|
|
- name: Make a crontab entry to restart kiwix-serve at 4AM (debuntu)
|
|
|
|
lineinfile:
|
|
|
|
# mn hr dy mo day-of-week[Sunday=0] username command-to-be-executed
|
|
|
|
line: "0 4 * * * root /bin/systemctl restart kiwix-serve.service"
|
|
|
|
dest: /etc/crontab
|
|
|
|
when: kiwix_enabled and is_debuntu
|
|
|
|
|
|
|
|
- name: Make a crontab entry to restart kiwix-serve at 4AM (redhat)
|
|
|
|
# * * * * * user-name command to be executed
|
|
|
|
lineinfile:
|
|
|
|
# mn hr dy mo day-of-week[Sunday=0] username command-to-be-executed
|
|
|
|
line: "0 4 * * * root /usr/bin/systemctl restart kiwix-serve.service"
|
|
|
|
dest: /etc/crontab
|
|
|
|
when: kiwix_enabled and is_redhat
|
|
|
|
|
|
|
|
|
|
|
|
- name: Enable/Disable/Restart Apache if primary
|
|
|
|
include_tasks: apache.yml
|
|
|
|
when: not nginx_enabled
|
|
|
|
|
|
|
|
- name: Enable/Disable/Restart NGINX if primary
|
|
|
|
include_tasks: nginx.yml
|
2020-10-16 20:46:19 +00:00
|
|
|
when: nginx_enabled
|