From 56e7a1f73e2257b2a4176ac1f16a4f6a3670d019 Mon Sep 17 00:00:00 2001 From: A Holt Date: Wed, 31 Oct 2018 02:05:59 -0400 Subject: [PATCH] Update main.yml --- roles/calibre/tasks/main.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index bc74b8121..ab16676c1 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -1,6 +1,6 @@ # 1. INSTALL THE LATEST CALIBRE 3.X+ (calibre, calibredb, calibre-server etc) ON ALL OS'S -- name: Check if /usr/bin/calibre exists +- name: Does /usr/bin/calibre exist? stat: path: "/usr/bin/calibre" register: calib_executable @@ -39,7 +39,7 @@ group: root mode: "{{ item.mode }}" backup: no -# register: calibre_config + #register: calibre_config with_items: - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} @@ -49,7 +49,7 @@ systemd: daemon_reload: yes when: (not calib_executable.stat.exists) -# when: calibre_config.changed + #when: calibre_config.changed # 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled) @@ -59,14 +59,13 @@ # register: calibre_svc - name: Stop Calibre service -- calibre-server by Kovid Goyal -# systemd: - service: + systemd: name: calibre-serve state: stopped #enabled: no -# register: command_result # gist.github.com/tyrells/0a79681de339237cb04c -# failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!) -# when: calibre_svc.stat.exists + #register: command_result # gist.github.com/tyrells/0a79681de339237cb04c + #failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!) + #when: calibre_svc.stat.exists # 3. CREATE USER DATABASE @@ -87,7 +86,7 @@ # 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) -- name: Check if /library/calibre/metadata.db exists +- name: Does /library/calibre/metadata.db exist? stat: path: "{{ calibre_dbpath }}/metadata.db" register: calibre_db @@ -104,20 +103,20 @@ # https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2 # (anyway this works great for calibre-web, allowing http://box/books # to work even better than http://box:8083 when box == 192.168.0.x !) -- name: Create calibre.conf link for UNTESTED http://box/calibre etc (debuntu) +- name: Create symlink calibre.conf from sites-enabled to sites-available, for UNTESTED http://box/calibre etc (debuntu) file: src: /etc/apache2/sites-available/calibre.conf dest: /etc/apache2/sites-enabled/calibre.conf state: link when: calibre_enabled and is_debuntu -- name: Remove calibre.conf link if disabled (debuntu) +- name: Remove symlink /etc/apache2/sites-enabled/calibre.conf (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 +- name: Enable & Start Calibre service -- runs calibre-server by Kovid Goyal service: name: calibre-serve enabled: yes @@ -126,14 +125,14 @@ #async: 900 #poll: 5 -- name: Forcing apache to reread configs - service: +- name: Reload Apache + systemd: name: "{{ apache_service }}" state: reloaded -- name: Add 'calibre' to list of services at {{ iiab_ini_file }} +- name: Add 'calibre' variable values to {{ iiab_ini_file }} ini_file: - dest: "{{ iiab_ini_file }}" + path: "{{ iiab_ini_file }}" section: calibre option: "{{ item.option }}" value: "{{ item.value }}"