mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Merge pull request #603 from holta/calibre-fix
Calibre fix: create unit file at the beginning, to avoid "ignore errors"
This commit is contained in:
commit
072dbe0f8d
1 changed files with 20 additions and 20 deletions
|
@ -11,6 +11,24 @@
|
||||||
when: is_rpi or (is_debian and calibre_debs_on_debian)
|
when: is_rpi or (is_debian and calibre_debs_on_debian)
|
||||||
#when: is_rpi or is_debian # (is_debian also covers & includes is_rpi)
|
#when: is_rpi or is_debian # (is_debian also covers & includes is_rpi)
|
||||||
|
|
||||||
|
- name: Create calibre-serve.service and calibre.conf
|
||||||
|
template:
|
||||||
|
src: "{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "{{ item.mode }}"
|
||||||
|
backup: no
|
||||||
|
register: calibre_config
|
||||||
|
with_items:
|
||||||
|
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
|
||||||
|
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
|
||||||
|
|
||||||
|
- name: Forcing systemd to reread configs
|
||||||
|
systemd:
|
||||||
|
daemon_reload: yes
|
||||||
|
when: calibre_config.changed
|
||||||
|
|
||||||
# 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
|
# 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
|
||||||
|
|
||||||
#- name: Check if Calibre systemd service exists
|
#- name: Check if Calibre systemd service exists
|
||||||
|
@ -25,7 +43,7 @@
|
||||||
state: stopped
|
state: stopped
|
||||||
#enabled: no
|
#enabled: no
|
||||||
# register: command_result # gist.github.com/tyrells/0a79681de339237cb04c
|
# register: command_result # gist.github.com/tyrells/0a79681de339237cb04c
|
||||||
failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!)
|
# failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!)
|
||||||
# when: calibre_svc.stat.exists
|
# when: calibre_svc.stat.exists
|
||||||
|
|
||||||
# 3. CREATE DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x)
|
# 3. CREATE DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x)
|
||||||
|
@ -39,20 +57,7 @@
|
||||||
include_tasks: create-db.yml
|
include_tasks: create-db.yml
|
||||||
when: not calibre_db.stat.exists
|
when: not calibre_db.stat.exists
|
||||||
|
|
||||||
# 4. WRAP UP: CALIBRE SERVICE, http://box/books ETC
|
# 4. WRAP UP: ENABLE CALIBRE SERVICE, http://box/books ETC
|
||||||
|
|
||||||
- name: Create calibre-serve.service and calibre.conf
|
|
||||||
template:
|
|
||||||
backup: no
|
|
||||||
src: "{{ item.src }}"
|
|
||||||
dest: "{{ item.dest }}"
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: "{{ item.mode }}"
|
|
||||||
register: calibre_config
|
|
||||||
with_items:
|
|
||||||
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
|
|
||||||
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
|
|
||||||
|
|
||||||
# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/books ARE A MESS (BOOKS RARELY DISPLAY)
|
# http://box:8080 & http://box:8080/mobile WORK BUT OTHER URL'S LIKE http://box/books ARE A MESS (BOOKS RARELY DISPLAY)
|
||||||
- name: Create calibre.conf link for UNTESTED http://box/books etc (debuntu)
|
- name: Create calibre.conf link for UNTESTED http://box/books etc (debuntu)
|
||||||
|
@ -68,11 +73,6 @@
|
||||||
state: absent
|
state: absent
|
||||||
when: (not calibre_enabled) and is_debuntu
|
when: (not calibre_enabled) and is_debuntu
|
||||||
|
|
||||||
- name: Forcing systemd to reread configs
|
|
||||||
systemd:
|
|
||||||
daemon_reload: yes
|
|
||||||
when: calibre_config.changed
|
|
||||||
|
|
||||||
- name: Enable Calibre service -- runs calibre-server by Kovid Goyal
|
- name: Enable Calibre service -- runs calibre-server by Kovid Goyal
|
||||||
service:
|
service:
|
||||||
name: calibre-serve
|
name: calibre-serve
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue