From 702bf30a020b8a0c36a9402d08b2729922ea6c4c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sat, 11 Jan 2020 17:37:33 -0500 Subject: [PATCH] Update calibre-web/tasks/enable.yml --- roles/calibre-web/tasks/enable.yml | 52 ++++++++++++++---------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/roles/calibre-web/tasks/enable.yml b/roles/calibre-web/tasks/enable.yml index e7dcf2364..60422823c 100644 --- a/roles/calibre-web/tasks/enable.yml +++ b/roles/calibre-web/tasks/enable.yml @@ -6,55 +6,55 @@ state: restarted when: calibreweb_enabled | bool -- name: Disable 'calibre-web' systemd service +- name: Disable & Stop 'calibre-web' systemd service systemd: name: calibre-web - daemon_reload: yes enabled: no state: stopped when: not calibreweb_enabled -# APACHE - -# Default: http://box/books # SEE ALSO: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy -- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache - command: a2ensite calibre-web.conf - when: calibreweb_enabled and not nginx_enabled -- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} with Apache +# Apache + +# i.e. http://box/books, http://box/libros, http://box/livres + +- name: Enable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} via Apache + command: a2ensite calibre-web.conf + when: apache_install and calibreweb_enabled + +- name: Disable http://box{{ calibreweb_url1 }}, http://box{{ calibreweb_url2 }}, http://box{{ calibreweb_url3 }} via Apache command: a2dissite calibre-web.conf - when: (not calibreweb_enabled or nginx_enabled) and apache_install + when: apache_install and not calibreweb_enabled - name: Restart Apache systemd service ({{ apache_service }}) systemd: - name: "{{ apache_service }}" # httpd or apache2 + name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/.yml state: restarted - when: not nginx_enabled + when: apache_enabled | bool # NGINX -- name: Remove {{ nginx_config_dir }}/calibre-web-nginx.conf - file: - path: "{{ nginx_config_dir }}/calibre-web-nginx.conf" - state: absent - when: not calibreweb_enabled or not nginx_enabled +# TO DO: restore http://box/libros & http://box/livres, along English (http://box/books) -- name: 'Install from template: {{ nginx_config_dir }}/calibre-web-nginx.conf' +- name: Enable http://box{{ calibreweb_url1 }} via NGINX, by installing {{ nginx_config_dir }}/calibre-web-nginx.conf from template template: src: calibre-web-nginx.conf.j2 dest: "{{ nginx_config_dir }}/calibre-web-nginx.conf" - owner: root # Not nec? Remove? - group: root # Not nec? Remove? - mode: 0644 # Not nec? Remove? - when: calibreweb_enabled and nginx_enabled + when: nginx_install and calibreweb_enabled -- name: Restart nginx systemd service +- name: Disable http://box{{ calibreweb_url1 }} via NGINX, by removing {{ nginx_config_dir }}/calibre-web-nginx.conf + file: + path: "{{ nginx_config_dir }}/calibre-web-nginx.conf" + state: absent + when: nginx_install and not calibreweb_enabled + +- name: Restart 'nginx' systemd service systemd: name: nginx - daemon_reload: yes state: restarted - when: calibreweb_enabled and nginx_enabled + when: nginx_enabled | bool + - name: Add 'calibre-web' variable values to {{ iiab_ini_file }} ini_file: @@ -83,5 +83,3 @@ value: "{{ calibreweb_database }}" - option: calibreweb_enabled value: "{{ calibreweb_enabled }}" -# - option: calibreweb_provision -# value: "{{ calibreweb_provision }}"