mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
kiwix - softcode nginx_config_dir, add disable logic
This commit is contained in:
parent
3d9bf9c83a
commit
b7a148de63
1 changed files with 22 additions and 6 deletions
|
@ -3,7 +3,7 @@
|
||||||
src: /etc/apache2/sites-available/kiwix.conf
|
src: /etc/apache2/sites-available/kiwix.conf
|
||||||
path: /etc/apache2/sites-enabled/kiwix.conf
|
path: /etc/apache2/sites-enabled/kiwix.conf
|
||||||
state: link
|
state: link
|
||||||
when: kiwix_enabled | bool and not nginx_enabled | bool
|
when: kiwix_enabled and not nginx_enabled
|
||||||
|
|
||||||
- name: Install nginx support
|
- name: Install nginx support
|
||||||
template:
|
template:
|
||||||
|
@ -14,14 +14,20 @@
|
||||||
group: root
|
group: root
|
||||||
mode: "{{ item.mode }}"
|
mode: "{{ item.mode }}"
|
||||||
with_items:
|
with_items:
|
||||||
- { src: 'kiwix-nginx.conf', dest: '/etc/nginx/conf.d/kiwix-nginx.conf', mode: '0644' }
|
- { src: 'kiwix-nginx.conf', dest: '{{ nginx_config_dir }}/kiwix-nginx.conf', mode: '0644' }
|
||||||
when: kiwix_enabled | bool and nginx_enabled | bool
|
when: kiwix_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
|
- name: Remove symlink /etc/apache2/sites-enabled/kiwix.conf
|
||||||
file:
|
file:
|
||||||
path: /etc/apache2/sites-enabled/kiwix.conf
|
path: /etc/apache2/sites-enabled/kiwix.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: not kiwix_enabled | bool or nginx_enabled | bool
|
when: not kiwix_enabled or nginx_enabled
|
||||||
|
|
||||||
|
- name: Remove {{ nginx_config_dir }}/kiwix-nginx.conf
|
||||||
|
file:
|
||||||
|
path: "{{ nginx_config_dir }}/kiwix-nginx.conf"
|
||||||
|
state: absent
|
||||||
|
when: not kiwix_enabled and nginx_enabled
|
||||||
|
|
||||||
- name: Enable & Restart 'kiwix-serve' service
|
- name: Enable & Restart 'kiwix-serve' service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -29,7 +35,7 @@
|
||||||
name: kiwix-serve
|
name: kiwix-serve
|
||||||
enabled: yes
|
enabled: yes
|
||||||
state: restarted
|
state: restarted
|
||||||
when: kiwix_enabled | bool
|
when: kiwix_enabled
|
||||||
|
|
||||||
- name: Disable 'kiwix-serve' service
|
- name: Disable 'kiwix-serve' service
|
||||||
systemd:
|
systemd:
|
||||||
|
@ -59,9 +65,19 @@
|
||||||
when: kiwix_enabled and is_redhat
|
when: kiwix_enabled and is_redhat
|
||||||
|
|
||||||
- name: Restart Apache, so it picks up kiwix.conf
|
- name: Restart Apache, so it picks up kiwix.conf
|
||||||
service:
|
systemd:
|
||||||
name: "{{ apache_service }}"
|
name: "{{ apache_service }}"
|
||||||
state: restarted
|
state: restarted
|
||||||
|
daemon-reload: yes
|
||||||
|
when: not nginx_enabled
|
||||||
|
|
||||||
|
- name: Restart nginx service
|
||||||
|
systemd:
|
||||||
|
name: nginx
|
||||||
|
state: restarted
|
||||||
|
daemon-reload: yes
|
||||||
|
when: nginx_enabled
|
||||||
|
|
||||||
|
|
||||||
# 5. FINALIZE
|
# 5. FINALIZE
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue