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

Merge pull request #785 from holta/calibre-u18

Toughen Calibre installs ACROSS OS's, GUI or not: apt then debs-OR-installer.py
This commit is contained in:
A Holt 2018-05-11 11:10:36 -04:00 committed by GitHub
commit 6946323a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 158 additions and 71 deletions

View file

@ -12,7 +12,7 @@ calibre_sample_book: "Metamorphosis-jackson.epub"
calibre_src_url: "https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py"
# USE TO TEST debs.yml (RASPBIAN APPROACH!) ON DEBIAN 9.X
calibre_debs_on_debian: True
# enable calibre unstable
calibre_unstable: False
# USE TO TEST debs.yml (RASPBIAN APPROACH!) ON DEBIAN 9.X: (now handled by calibre_via_debs in /opt/iiab/iiab/vars/*)
#calibre_debs_on_debian: True
# Enable unstable .deb's, not just testing .deb's: (moved to vars/local_vars.yml & vars/default_vars.yml)
#calibre_unstable_debs: False

View file

@ -1,24 +1,31 @@
- name: Start by installing OS's Calibre package
package:
name: "{{ item }}"
state: latest
with_items:
- calibre
- calibre-bin
when: internet_available
# roles/calibre/tasks/main.yml requires calibre_via_debs (to be True) before calling this script.
# April 5 2018 raspbian is now tracking the latest Calibre with a small delay.
# Should you really want the latest just run the below script standalone, it is
# strongly suggested that waiting for the lastest deb from Raspbian is the best.
# MOVED UP TO roles/calibre/tasks/main.yml
#- name: Start by installing OS's Calibre package
# package:
# name: "{{ item }}"
# state: latest
# with_items:
# - calibre
# - calibre-bin
# when: internet_available
- name: Upgrade to testing Calibre - RPi
# April/May 2018: Raspbian .deb's for the latest Calibre now appear
# (http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/)
# within about 10 days of Calibre's quasi-monthly releases
# (https://calibre-ebook.com/whats-new).
# If you want the latest Calibre, run the appropriate below script, standalone.
# HOWEVER: it's strongly suggested you wait for apt (blessed by your OS!)
- name: Upgrade to Calibre testing .deb's - target Raspbian (rpi)
command: scripts/calibre-install-latest-rpi.sh
when: is_rpi and internet_available
- name: Upgrade to testing Calibre - non-RPi
- name: Upgrade to Calibre testing .deb's - target Ubuntu 16.04 (not rpi and not ubuntu_18)
command: scripts/calibre-install-latest.sh
when: not is_rpi and not is_ubuntu_18 and internet_available
- name: Upgrade to unstable Calibre - all
- name: Upgrade to Calibre unstable .deb's IF calibre_unstable_debs
command: scripts/calibre-install-unstable.sh
when: calibre_unstable and internet_available
when: calibre_unstable_debs and internet_available

View file

@ -1,18 +1,36 @@
# 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre-server etc) ON ALL OS'S
# 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S
# RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST
- name: Install Calibre via calibre-installer.py (redhat, ubuntu, debian if NOT calibre_debs_on_debian)
include_tasks: py-installer.yml
when: is_redhat or is_ubuntu or (is_debian and not calibre_debs_on_debian)
#when: not is_rpi
- name: Check if /usr/bin/calibre exists
stat:
path: "/usr/bin/calibre"
register: calib_executable
- name: Install Calibre via .debs (Raspbian, Debian if calibre_debs_on_debian)
- name: Install Calibre via OS's package installer (IF /usr/bin/calibre MISSING)
package:
name: "{{ item }}"
state: latest
with_items:
- calibre
- calibre-bin
when: internet_available and (not calib_executable.stat.exists)
- name: Install Calibre experimental .debs IF calibre_via_debs (AND /usr/bin/calibre WAS MISSING)
include_tasks: debs.yml
when: is_rpi or (is_debian and calibre_debs_on_debian)
when: calibre_via_debs and (not calib_executable.stat.exists)
#- name: Install Calibre via .debs (Ubuntu 18.xx)
# include_tasks: debs.yml
# when: is_ubuntu_18
- name: Install Calibre via calibre-installer.py IF calibre_via_python (AND /usr/bin/calibre WAS MISSING)
include_tasks: py-installer.yml
when: calibre_via_python and (not calib_executable.stat.exists)
# 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
# .deb's (http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/)
# are updated within about 10 days of Calibre's quasi-monthly releases!
#
# BUT IF ABSOLUTELY NEC: (SEE roles/calibre/tasks/debs.yml)
# - run testing branch for RPi: scripts/calibre-install-latest-rpi.sh
# - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh
# - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh
- name: Create calibre-serve.service and calibre.conf
template:
@ -27,7 +45,7 @@
- { 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
- name: Force systemd to reread configs
systemd:
daemon_reload: yes
when: calibre_config.changed

View file

@ -1,5 +1,7 @@
# roles/calibre/tasks/main.yml requires calibre_via_python (to be True) before calling this script.
# Seems to work with just about any Linux (Fedora 18 on OLPC XO Laptops??) and deals with dependencies.
# But is arch dependent: requires x86_64 or i686 for now.
# BUT IS ARCH DEPENDENT: requires x86_64 or i686 as of early 2018.
- name: Download latest linux-installer.py from GitHub to calibre-installer.py
get_url:
@ -32,21 +34,23 @@
path: "{{ downloads_dir }}/calibre-installer.py"
register: calib_inst
- name: Check if calibre-uninstall exists in /usr/bin
stat:
path: "/usr/bin/calibre-uninstall"
register: calib_uninst
# MOVED UP TO roles/calibre/tasks/main.yml (now checks for /usr/bin/calibre)
#- name: Check if calibre-uninstall exists in /usr/bin
# stat:
# path: "/usr/bin/calibre-uninstall"
# register: calib_uninst
- name: FAIL (force Ansible to exit) IF /opt/iiab/downloads/calibre-installer.py doesn't exist OR needed Internet connection is missing
- name: FAIL (force Ansible to exit) IF /opt/iiab/downloads/calibre-installer.py OR Internet ARE MISSING
# meta: end_play
fail:
msg: "{{ downloads_dir }}/calibre-installer.py and an Internet connection are REQUIRED in order to install Calibre!"
when: (not calib_inst.stat.exists) or (not internet_available and not calib_uninst.stat.exists)
when: (not calib_inst.stat.exists) or (not internet_available)
#when: (not calib_inst.stat.exists) or (not internet_available and not calib_uninst.stat.exists)
# INSTALL THE LATEST CALIBRE (calibre-server etc) - RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST
# INSTALL THE LATEST CALIBRE (calibre, calibredb, calibre-server etc)
- name: Run calibre-installer.py to install Calibre programs into /usr/bin - MANUALLY REMOVE /usr/bin/calibre-uninstall TO FORCE calibre-installer.py TO REINSTALL/UPGRADE HERE!
- name: Run calibre-installer.py to install Calibre programs into /usr/bin
shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
args:
creates: /usr/bin/calibre-uninstall
#args:
# creates: /usr/bin/calibre-uninstall
when: internet_available

View file

@ -1,19 +1,23 @@
#!/bin/bash
# Thanks to Jerry Vonau (https://github.com/jvonau) who made
# this critical breakthrough (Calibre 3.x on Raspbian) possible!
# The latest available is 3.21 available from testing
# Thanks to Jerry Vonau (https://github.com/jvonau) who made this critical
# breakthrough possible!
#
# Calibre 3.23 is the latest available from testing as of 2018-05-10:
#
# http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/
# http://archive.raspbian.org/raspbian/pool/main/c/calibre/
# https://packages.debian.org/search?keywords=calibre
# (SEE http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/
# OR http://archive.raspbian.org/raspbian/pool/main/c/calibre/ ?)
# Might break future updates, you have been warned.
# http://deb.debian.org/debian/pool/main/c/calibre/
#
# Might break future updates; you have been warned.
export DEBIAN_FRONTEND=noninteractive
# Updates calibre calibre-bin to version 3.21 or ... from testing
# Prepares to update to latest from testing
echo "deb http://raspbian.raspberrypi.org/raspbian/ testing main" > /etc/apt/sources.list.d/rpi-testing.list
apt update
apt -y install calibre calibre-bin
# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list
# Removes last line, safer than: rm /etc/apt/sources.list.d/rpi-testing.list
sed -i '$ d' /etc/apt/sources.list.d/rpi-testing.list
# Clears the cache of testing
apt update

View file

@ -1,20 +1,26 @@
#!/bin/bash
# Thanks to Jerry Vonau (https://github.com/jvonau) who made
# this critical breakthrough for Calibre 3.x possible!
# The latest available is 3.20 available from testing
# Thanks to Jerry Vonau (https://github.com/jvonau) who made this critical
# breakthrough possible!
#
# Calibre 3.23 is the latest available from testing as of 2018-05-10:
#
# https://packages.debian.org/search?keywords=calibre
# (SEE http://deb.debian.org/debian/pool/main/c/calibre/ ?)
# might break future updates, you have been warned
# http://deb.debian.org/debian/pool/main/c/calibre/
# http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/
# http://archive.raspbian.org/raspbian/pool/main/c/calibre/
#
# Might break future updates; you have been warned.
export DEBIAN_FRONTEND=noninteractive
# Drags in stock desktop dependencies without too much from testing below
apt -y install calibre-bin dirmngr
# Updates calibre calibre-bin to version 3.20 or ... from testing
apt -y install dirmngr
# Prepares to update to latest from testing
apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010
echo "deb http://deb.debian.org/debian testing main" >> /etc/apt/sources.list.d/debian-testing.list
apt update
apt -y install libqt5core5a python-lxml calibre
# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list
apt -y install libqt5core5a python-lxml calibre calibre-bin
# Removes last line, safer than: rm /etc/apt/sources.list.d/debian-testing.list
sed -i '$ d' /etc/apt/sources.list.d/debian-testing.list
# Clears the cache of testing
apt update

View file

@ -1,18 +1,24 @@
#!/bin/bash
# Thanks to Jerry Vonau (https://github.com/jvonau) who made
# this critical breakthrough possible!
# might break future updates, you have been warned
# The latest available is 3.20 available from testing
# Thanks to Jerry Vonau (https://github.com/jvonau) who made this critical
# breakthrough possible!
#
# Calibre 3.23 is the latest available from testing as of 2018-05-10:
#
# https://packages.debian.org/search?keywords=calibre
# might break future updates, you have been warned
# http://deb.debian.org/debian/pool/main/c/calibre/
# http://raspbian.raspberrypi.org/raspbian/pool/main/c/calibre/
# http://archive.raspbian.org/raspbian/pool/main/c/calibre/
#
# Might break future updates; you have been warned.
export DEBIAN_FRONTEND=noninteractive
# Updates to calibre & calibre-bin to "very latest" 3.x from unstable
# Prepares to update to latest from unstable
apt-key adv --recv-key --keyserver keyserver.ubuntu.com 7638D0442B90D010
echo "deb http://deb.debian.org/debian unstable main" >> /etc/apt/sources.list.d/unstable.list
apt update
apt -y install calibre calibre-bin
# Remove last line, safer than: rm /etc/apt/sources.list.d/debian-unstable.list
# Removes last line, safer than: rm /etc/apt/sources.list.d/unstable.list
sed -i '$ d' /etc/apt/sources.list.d/unstable.list
# Clears the cache of testing and unstable
apt update

View file

@ -18,3 +18,6 @@ sshd_service: sshd
php_version: 7.0
postgresql_version: 9.5
systemd_location: /usr/lib/systemd/system
# Upgrade OS's own Calibre to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -18,3 +18,6 @@ sshd_service: ssh
php_version: 5
postgresql_version: 9.4
systemd_location: /lib/systemd/system
# Upgrade OS's own Calibre to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -19,5 +19,6 @@ sshd_service: ssh
php_version: 7.0
postgresql_version: 9.6
systemd_location: /lib/systemd/system
# Upgrade OS's own Calibre to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -242,6 +242,11 @@ idmgr_enables: False
calibre_install: True
calibre_enabled: True
# vars/raspbian-9.yml tries the .deb upgrade of Calibre, overriding this default:
calibre_via_debs: False
calibre_unstable_debs: False
# vars/<most-OS's>.yml try the x86_64 python upgrade of Calibre, overriding this default:
calibre_via_python: False
# Change calibre_port to 8010 if you're using XO laptops needing above idmgr
calibre_port: 8080
# Change calibre to XYZ add your own mnemonic URL like: http://box/XYZ

View file

@ -18,3 +18,6 @@ sshd_service: sshd
nextcloud_install: False
nextcloud_enabled: False
systemd_location: /usr/lib/systemd/system
# Upgrade OS's own Calibre to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -14,3 +14,6 @@ mysql_service: mariadb
apache_log: /var/log/httpd/access_log
sshd_service: sshd
systemd_location: /usr/lib/systemd/system
# Upgrade OS's own Calibre to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -125,6 +125,11 @@ iiab_usb_lib_show_all: True
calibre_install: True
calibre_enabled: True
# Try .deb upgrade of Calibre (like vars/raspbian-9.yml already does)
# calibre_via_debs: True
calibre_unstable_debs: False
# Try python x86_64 upgrade of Calibre (like vars/<most-OS's>.yml already do)
# calibre_via_python: True
# Change calibre_port to 8010 if you're using XO laptops needing above idmgr
calibre_port: 8080
# Change calibre to XYZ add your own mnemonic URL like: http://box/XYZ

View file

@ -20,3 +20,8 @@ sshd_service: ssh
php_version: 5
postgresql_version: 9.4
systemd_location: /lib/systemd/system
# Upgrade Raspbian Jessie's Calibre 2.5.0: (via role/calibre/tasks/debs.yml,
# with .deb's released about 5-10 days after Calibre's quasi-monthly releases)
calibre_via_debs: True
# roles/calibre/tasks/py-installer.yml FAILS on ARM as of 2018-05-10:
calibre_via_python: False

View file

@ -21,3 +21,8 @@ sshd_service: ssh
php_version: 7.0
postgresql_version: 9.6
systemd_location: /lib/systemd/system
# Upgrade Raspbian Stretch's Calibre 2.75.1: (via role/calibre/tasks/debs.yml,
# with .deb's released about 5-10 days after Calibre's quasi-monthly releases)
calibre_via_debs: True
# roles/calibre/tasks/py-installer.yml FAILS on ARM as of 2018-05-10:
calibre_via_python: False

View file

@ -19,3 +19,6 @@ sshd_service: ssh
php_version: 7.0
postgresql_version: 9.5
systemd_location: /lib/systemd/system
# Upgrade Ubuntu 16.04's Calibre 2.55.0 to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -19,3 +19,6 @@ sshd_service: ssh
php_version: 7.1
postgresql_version: 9.6
systemd_location: /lib/systemd/system
# Upgrade Ubuntu 17.10's Calibre 3.7.0 to very latest:
calibre_via_debs: False
calibre_via_python: True

View file

@ -21,3 +21,6 @@ php_version: 7.2
# "postgresql_version: 10.3" fails (too detailed for /etc/systemd/system/postgresql-iiab.service on Ubuntu 18.04)
postgresql_version: 10
systemd_location: /lib/systemd/system
# Upgrade Ubuntu 18.04's Calibre 3.21.0 to very latest:
calibre_via_debs: False
calibre_via_python: True