1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +00:00

Update calibre/tasks/install.yml

This commit is contained in:
A Holt 2020-04-29 18:41:15 -04:00 committed by GitHub
parent 81ad70277e
commit 719d680d4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,25 +1,22 @@
# 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S # 1. INSTALL CALIBRE 4.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S
- name: Does /usr/bin/calibre exist? #- name: "Install OS's latest packages: calibre, calibre-bin"
stat: # package:
path: "/usr/bin/calibre" # name:
register: calib_executable # - calibre
# - calibre-bin
# state: latest
- name: "Install OS's latest packages: calibre, calibre-bin (IF not rpi AND /usr/bin/calibre MISSING)" # May require above 2 pkgs first?
package: - name: Install Calibre via .debs (raspbian)
name: command: scripts/calibre-install-latest-rpi.sh # WORKED for Calibre 3.33.1 on 2018-10-23. And Calibre 3.28 on 2018-07-26 (PR #971). Likewise for Calibre 3.26.x. FAILED with Calibre 3.24+ ("calibre : Depends: python-pyqt5 (>= 5.10.1+dfsg-2) but 5.10.1+dfsg-1+rpi1 is to be installed") since June 2018.
- calibre #include_tasks: debs.yml
- calibre-bin when: is_raspbian | bool
state: latest
when: internet_available and not is_raspbian and (not calib_executable.stat.exists)
- name: Install Calibre .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING) # May require above 2 pkgs first?
include_tasks: debs.yml - name: Install Calibre via py-installer.yml -> calibre-installer.py (not raspbian)
when: calibre_via_debs and (not calib_executable.stat.exists)
- name: Install Calibre via calibre-installer.py IF calibre_via_python (AND /usr/bin/calibre WAS MISSING)
include_tasks: py-installer.yml include_tasks: py-installer.yml
when: calibre_via_python and (not calib_executable.stat.exists) when: not is_raspbian
# SEE calibre_via_python's value vars/default_vars.yml, vars/ubuntu-18.yml & # SEE calibre_via_python's value vars/default_vars.yml, vars/ubuntu-18.yml &
# vars/raspbian-9.yml: try to AVOID Python installer on Raspbian since its # vars/raspbian-9.yml: try to AVOID Python installer on Raspbian since its
@ -34,19 +31,13 @@
# 2. SYSTEMD SERVICES # 2. SYSTEMD SERVICES
- name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING) - name: Create /etc/systemd/system/calibre-serve.service and /etc/calibre.conf
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
owner: root
group: root
mode: "{{ item.mode }}"
backup: no
#register: calibre_config
with_items: with_items:
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service'}
- { src: 'calibre.conf', dest: '/etc/{{ apache_conf_dir }}', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_conf_dir }}'}
when: (not calib_executable.stat.exists)
- name: Stop service 'calibre-serve' (/usr/bin/calibre-server by Kovid Goyal) - name: Stop service 'calibre-serve' (/usr/bin/calibre-server by Kovid Goyal)
systemd: systemd:
@ -57,20 +48,15 @@
# 3. CREATE USER DATABASE # 3. CREATE USER DATABASE
- name: Create /library/calibre (mandatory since Calibre 3.x) - name: Create {{ calibre_dbpath }} (mandatory since Calibre 3.x)
file: file:
path: "{{ calibre_dbpath }}" path: "{{ calibre_dbpath }}" # /library/calibre
state: directory state: directory
#mode: 0755
- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING) - name: Copy template userdb to {{ calibre_userdb }}
copy: copy:
src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite
dest: "{{ calibre_userdb }}" dest: "{{ calibre_userdb }}" # /library/calibre/users.sqlite
owner: root
group: root
mode: 0644
when: (not calib_executable.stat.exists)
# 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) # 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x)