From 7a4a9211a1ace04b5b4a2aa9ced9cc2955913f8f Mon Sep 17 00:00:00 2001 From: A Holt Date: Mon, 20 Nov 2017 03:01:38 -0500 Subject: [PATCH] Update main.yml --- roles/calibre/tasks/main.yml | 39 ++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 17fbe71dc..23d45d5d2 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -1,21 +1,22 @@ +# INSTALL THE LATEST CALIBRE (calibre-server etc) ON ALL OS'S + +# RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST +- name: Install Calibre via calibre-installer.py (OS's other than Raspbian) + include_tasks: py-installer.yml + when: not is_rpi + #when: not calibre_db.stat.exists and (is_redhat or is_ubuntu) + +- name: Install Calibre via .debs (Raspbian) + include_tasks: debs.yml + when: is_rpi + +# CREATE CALIBRE DATABASE WITH A SAMPLE BOOK + - name: Check if /library/calibre/metadata.db exists stat: path: "{{ calibre_dbpath }}/metadata.db" register: calibre_db -# INSTALL THE LATEST CALIBRE (calibre-server etc) ON ALL OS'S - RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST - -- name: Install Calibre via calibre-installer.py - include_tasks: py-installer.yml - when: (not calibre_db.stat.exists) and (not is_rpi) - #when: not calibre_db.stat.exists and (is_redhat or is_ubuntu) - -- name: Install Calibre via .debs - include_tasks: debs.yml - when: (not calibre_db.stat.exists) and is_rpi - -# CREATE CALIBRE DATABASE WITH A SAMPLE BOOK - - name: Install Calibre - All include_tasks: config-db.yml when: not calibre_db.stat.exists @@ -43,6 +44,12 @@ state: link when: calibre_enabled and is_debuntu +- name: Remove calibre.conf link if disabled (debuntu) + file: + dest: /etc/apache2/sites-enabled/calibre.conf + state: absent + when: not calibre_enabled and is_debuntu + - name: Enable Calibre service -- runs calibre-server by Kovid Goyal service: name: calibre-serve @@ -52,12 +59,6 @@ #poll: 5 when: calibre_enabled -#- name: Remove calibre.conf link if disabled (debuntu) -# file: -# dest: /etc/apache2/sites-enabled/calibre.conf -# state: absent -# when: not calibre_enabled and is_debuntu - #- name: Disable Calibre service -- stops calibre-server by Kovid Goyal # service: name=calibre-serve # enabled=no