1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Update calibre-web/tasks/enable.yml

This commit is contained in:
A Holt 2020-01-11 17:37:33 -05:00 committed by GitHub
parent f80d48e764
commit 702bf30a02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,55 +6,55 @@
state: restarted state: restarted
when: calibreweb_enabled | bool when: calibreweb_enabled | bool
- name: Disable 'calibre-web' systemd service - name: Disable & Stop 'calibre-web' systemd service
systemd: systemd:
name: calibre-web name: calibre-web
daemon_reload: yes
enabled: no enabled: no
state: stopped state: stopped
when: not calibreweb_enabled when: not calibreweb_enabled
# APACHE
# Default: http://box/books
# SEE ALSO: https://github.com/janeczku/calibre-web/wiki/Setup-Reverse-Proxy # 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 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 }}) - name: Restart Apache systemd service ({{ apache_service }})
systemd: systemd:
name: "{{ apache_service }}" # httpd or apache2 name: "{{ apache_service }}" # apache2 or httpd, as set in /opt/iiab/iiab/vars/<OS>.yml
state: restarted state: restarted
when: not nginx_enabled when: apache_enabled | bool
# NGINX # NGINX
- name: Remove {{ nginx_config_dir }}/calibre-web-nginx.conf # TO DO: restore http://box/libros & http://box/livres, along English (http://box/books)
file:
path: "{{ nginx_config_dir }}/calibre-web-nginx.conf"
state: absent
when: not calibreweb_enabled or not nginx_enabled
- 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: template:
src: calibre-web-nginx.conf.j2 src: calibre-web-nginx.conf.j2
dest: "{{ nginx_config_dir }}/calibre-web-nginx.conf" dest: "{{ nginx_config_dir }}/calibre-web-nginx.conf"
owner: root # Not nec? Remove? when: nginx_install and calibreweb_enabled
group: root # Not nec? Remove?
mode: 0644 # Not nec? Remove?
when: calibreweb_enabled and nginx_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: systemd:
name: nginx name: nginx
daemon_reload: yes
state: restarted state: restarted
when: calibreweb_enabled and nginx_enabled when: nginx_enabled | bool
- name: Add 'calibre-web' variable values to {{ iiab_ini_file }} - name: Add 'calibre-web' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
@ -83,5 +83,3 @@
value: "{{ calibreweb_database }}" value: "{{ calibreweb_database }}"
- option: calibreweb_enabled - option: calibreweb_enabled
value: "{{ calibreweb_enabled }}" value: "{{ calibreweb_enabled }}"
# - option: calibreweb_provision
# value: "{{ calibreweb_provision }}"