1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Update kiwix/tasks/enable.yml

This commit is contained in:
A Holt 2020-01-11 13:56:39 -05:00 committed by GitHub
parent 3dc610d33f
commit 2a11796af0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,37 +36,37 @@
# Apache
- name: Enable http://box/kiwix with Apache proxy
- name: "Enable http://box{{ kiwix_url_without_slash }} via Apache"
command: a2ensite kiwix.conf
when: kiwix_enabled and not nginx_enabled
when: apache_install and kiwix_enabled
- name: Disable http://box/kiwix with Apache
command: a2dissite calibre-web.conf
when: not kiwix_enabled or nginx_enabled
- name: "Disable http://box{{ kiwix_url_without_slash }} via Apache"
command: a2dissite kiwix.conf
when: apache_install and not kiwix_enabled
- name: Restart Apache systemd service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
daemon-reload: yes
state: restarted
when: not nginx_enabled
when: apache_enabled | bool
# NGINX
- name: 'Install from template: {{ nginx_config_dir }}/kiwix-nginx.conf'
- name: "Enable http://box{{ kiwix_url_without_slash }} via NGINX, by installing {{ nginx_config_dir }}/kiwix-nginx.conf from template"
template:
src: kiwix-nginx.conf
dest: "{{ nginx_config_dir }}/kiwix-nginx.conf"
owner: root # Not nec? Remove?
group: root # Not nec? Remove?
mode: '0644' # Not nec? Remove?
when: kiwix_enabled and nginx_enabled
when: nginx_install and kiwix_enabled
- name: Remove {{ nginx_config_dir }}/kiwix-nginx.conf
- name: "Disable http://box{{ kiwix_url_without_slash }} via NGINX, by removing {{ nginx_config_dir }}/kiwix-nginx.conf"
file:
path: "{{ nginx_config_dir }}/kiwix-nginx.conf"
state: absent
when: not kiwix_enabled or not nginx_enabled
when: nginx_install and not kiwix_enabled
- name: Restart nginx systemd service
systemd: