mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
invert calibre-installer.py logic
This commit is contained in:
parent
9385560d28
commit
20c629a7fe
1 changed files with 15 additions and 14 deletions
|
@ -7,7 +7,7 @@
|
||||||
force: yes
|
force: yes
|
||||||
backup: yes
|
backup: yes
|
||||||
register: calibre_download_output
|
register: calibre_download_output
|
||||||
when: internet_available
|
when: internet_available and is_redhat
|
||||||
|
|
||||||
# ALWAYS DEFINED, DESPITE get_url DOCUMENTATION CLAIM...
|
# ALWAYS DEFINED, DESPITE get_url DOCUMENTATION CLAIM...
|
||||||
# - debug:
|
# - debug:
|
||||||
|
@ -28,17 +28,19 @@
|
||||||
stat:
|
stat:
|
||||||
path: "{{ downloads_dir }}/calibre-installer.py"
|
path: "{{ downloads_dir }}/calibre-installer.py"
|
||||||
register: calib_inst
|
register: calib_inst
|
||||||
|
when: is_redhat
|
||||||
|
|
||||||
- name: Check if calibre-uninstall exists in /usr/bin
|
- name: Check if calibre-uninstall exists in /usr/bin
|
||||||
stat:
|
stat:
|
||||||
path: "/usr/bin/calibre-uninstall"
|
path: "/usr/bin/calibre-uninstall"
|
||||||
register: calib_uninst
|
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
|
# meta: end_play
|
||||||
fail:
|
# fail:
|
||||||
msg: "{{ downloads_dir }}/calibre-installer.py and an Internet connection are REQUIRED in order to install Calibre!"
|
# 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 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
|
# 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"
|
shell: "{{ downloads_dir }}/calibre-installer.py >> /dev/null"
|
||||||
args:
|
args:
|
||||||
creates: /usr/bin/calibre-uninstall
|
creates: /usr/bin/calibre-uninstall
|
||||||
when: internet_available
|
when: internet_available and is_redhat
|
||||||
|
|
||||||
# - name: Install Calibre (OS's other than CentOS)
|
- name: Install Calibre (OS's other than CentOS)
|
||||||
# # the fedora rpm arm version, though older, takes care of dependencies, and exists
|
package: name={{ item }}
|
||||||
# package: name={{ item }}
|
state=present
|
||||||
# state=present
|
with_items:
|
||||||
# with_items:
|
- calibre
|
||||||
# - calibre
|
when: calibre_install and ansible_distribution != 'CentOS'
|
||||||
# when: calibre_install and ansible_distribution != 'CentOS'
|
|
||||||
|
|
||||||
- name: Create calibre-serve.service and calibre.conf
|
- name: Create calibre-serve.service and calibre.conf
|
||||||
template:
|
template:
|
||||||
|
@ -88,7 +89,7 @@
|
||||||
file:
|
file:
|
||||||
path: "{{ calibre_dbpath }}"
|
path: "{{ calibre_dbpath }}"
|
||||||
state: directory
|
state: directory
|
||||||
mode: 0755
|
mode: 0666
|
||||||
|
|
||||||
- name: Check if sample book exists in /opt/iiab/downloads
|
- name: Check if sample book exists in /opt/iiab/downloads
|
||||||
stat:
|
stat:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue