2017-11-20 08:43:01 +00:00
# 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.
2017-11-19 20:33:53 +00:00
- name : Download latest linux-installer.py from GitHub to calibre-installer.py
get_url :
url : "{{ calibre_src_url }}"
dest : "{{ downloads_dir }}/calibre-installer.py"
mode : 0755
force : yes
backup : yes
2017-12-08 06:07:49 +00:00
timeout : "{{ download_timeout }}"
2017-11-19 20:33:53 +00:00
register : calibre_download_output
when : internet_available
# ALWAYS DEFINED, DESPITE get_url DOCUMENTATION CLAIM...
# - debug:
# msg: "{{ calibre_download_output.src }}"
#
# DEFINED ONLY WHEN /opt/iiab/downloads/calibre-installer.py CHANGES
# - debug:
# msg: "{{ calibre_download_output.backup_file }}"
# OOPS BAD IDEA: changes in https://github.com/kovidgoyal/calibre/commits/master/setup/linux-installer.py are not sync'd with Calibre releases!
# - name: FORCE AN UPGRADE IF calibre-installer.py HAS CHANGED, IF SO ORIGINAL IS SAVED TO {{ calibre_download_output.backup_file }}
# file:
# path: /usr/bin/calibre-uninstall
# state: absent
# when: calibre_download_output.backup_file is defined
- name : Check if calibre-installer.py exists in /opt/iiab/downloads
stat :
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
- name : FAIL (force Ansible to exit) IF /opt/iiab/downloads/calibre-installer.py doesn't exist OR needed Internet connection is missing
2017-11-20 09:23:29 +00:00
# meta: end_play
2017-11-19 20:33:53 +00:00
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)
2017-11-20 08:06:02 +00:00
# INSTALL THE LATEST CALIBRE (calibre-server etc) - RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST
2017-11-19 20:33:53 +00:00
- 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!
shell : "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
args :
creates : /usr/bin/calibre-uninstall
when : internet_available