1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00

invert calibre-installer.py logic

This commit is contained in:
Jerry Vonau 2017-11-19 13:38:57 -06:00
parent 9385560d28
commit 20c629a7fe

View file

@ -7,7 +7,7 @@
force: yes
backup: yes
register: calibre_download_output
when: internet_available
when: internet_available and is_redhat
# ALWAYS DEFINED, DESPITE get_url DOCUMENTATION CLAIM...
# - debug:
@ -28,17 +28,19 @@
stat:
path: "{{ downloads_dir }}/calibre-installer.py"
register: calib_inst
when: is_redhat
- name: Check if calibre-uninstall exists in /usr/bin
stat:
path: "/usr/bin/calibre-uninstall"
register: calib_uninst
when: is_redhat
- 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 doesn't exist OR needed Internet connection is 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)
# 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)
# INSTALL THE LATEST CALIBRE (calibre-server etc) ON ALL OS'S - RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST
@ -46,15 +48,14 @@
shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
args:
creates: /usr/bin/calibre-uninstall
when: internet_available
when: internet_available and is_redhat
# - name: Install Calibre (OS's other than CentOS)
# # the fedora rpm arm version, though older, takes care of dependencies, and exists
# package: name={{ item }}
# state=present
# with_items:
# - calibre
# when: calibre_install and ansible_distribution != 'CentOS'
- name: Install Calibre (OS's other than CentOS)
package: name={{ item }}
state=present
with_items:
- calibre
when: calibre_install and ansible_distribution != 'CentOS'
- name: Create calibre-serve.service and calibre.conf
template:
@ -88,7 +89,7 @@
file:
path: "{{ calibre_dbpath }}"
state: directory
mode: 0755
mode: 0666
- name: Check if sample book exists in /opt/iiab/downloads
stat: