1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-14 20:22:08 +00:00

Update main.yml

This commit is contained in:
A Holt 2018-10-31 02:05:59 -04:00 committed by GitHub
parent 5f84c7ecfa
commit 56e7a1f73e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 }}"