1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/calibre/tasks/enable.yml
2020-02-17 20:45:16 -05:00

49 lines
1.7 KiB
YAML

# 5. WRAP UP: ENABLE CALIBRE SERVICE, http://box/books ETC
# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/calibre ARE A MESS (BOOKS RARELY DISPLAY)
#
# 2018-08-27 POSSIBLE FIX...CONSIDER THIS ProxyPass / ProxyPassReverse TECHNIQUE:
# https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2
# (anyway this works great for calibre-web, allowing http://box/books
# to work even better than http://box:8083 when box == 192.168.0.x !)
- name: Attempt to enable http://box/calibre via Apache (UNTESTED)
command: a2ensite calibre.conf
when: apache_installed and calibre_enabled
- name: Attempt to disable http://box/calibre via Apache (UNTESTED)
command: a2dissite calibre.conf
when: apache_installed and not calibre_enabled
- name: Enable & Start service 'calibre-serve' (/usr/bin/calibre-server by Kovid Goyal)
service:
name: calibre-serve
enabled: yes
state: started
when: calibre_enabled | bool
#async: 900
#poll: 5
- name: Reload Apache service ({{ apache_service }})
systemd:
name: "{{ apache_service }}"
state: reloaded
- name: Add 'calibre' variable values to {{ iiab_ini_file }}
ini_file:
path: "{{ iiab_ini_file }}"
section: calibre
option: "{{ item.option }}"
value: "{{ item.value | string }}"
with_items:
- option: name
value: Calibre
- option: description
value: '"Calibre is an extremely popular personal library system for e-books."'
- option: url
value: "{{ calibre_src_url }}"
- option: database
value: "{{ calibre_dbpath }}"
- option: port
value: "{{ calibre_port }}"
- option: calibre_enabled
value: "{{ calibre_enabled }}"