1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-15 04:32:11 +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 # 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: stat:
path: "/usr/bin/calibre" path: "/usr/bin/calibre"
register: calib_executable register: calib_executable
@ -39,7 +39,7 @@
group: root group: root
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
backup: no backup: no
# register: calibre_config #register: calibre_config
with_items: with_items:
- { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'} - { src: 'calibre-serve.service.j2', dest: '/etc/systemd/system/calibre-serve.service', mode: '0644'}
- { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'} - { src: 'calibre.conf', dest: '/etc/{{ apache_config_dir }}', mode: '0644'}
@ -49,7 +49,7 @@
systemd: systemd:
daemon_reload: yes daemon_reload: yes
when: (not calib_executable.stat.exists) 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) # 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
@ -59,14 +59,13 @@
# register: calibre_svc # register: calibre_svc
- name: Stop Calibre service -- calibre-server by Kovid Goyal - name: Stop Calibre service -- calibre-server by Kovid Goyal
# systemd: systemd:
service:
name: calibre-serve name: calibre-serve
state: stopped state: stopped
#enabled: no #enabled: no
# register: command_result # gist.github.com/tyrells/0a79681de339237cb04c #register: command_result # gist.github.com/tyrells/0a79681de339237cb04c
# failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!) #failed_when: false # Never Fail during "systemctl stop calibre-serve" (even if service doesn't exist!)
# when: calibre_svc.stat.exists #when: calibre_svc.stat.exists
# 3. CREATE USER DATABASE # 3. CREATE USER DATABASE
@ -87,7 +86,7 @@
# 4. CREATE CONTENT DATABASE WITH A SAMPLE BOOK (REQUIRED AS OF CALIBRE 3.x) # 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: stat:
path: "{{ calibre_dbpath }}/metadata.db" path: "{{ calibre_dbpath }}/metadata.db"
register: calibre_db register: calibre_db
@ -104,20 +103,20 @@
# https://github.com/iiab/iiab/tree/master/roles/calibre-web/templates/calibre-web.conf.j2 # 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 # (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 !) # 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: file:
src: /etc/apache2/sites-available/calibre.conf src: /etc/apache2/sites-available/calibre.conf
dest: /etc/apache2/sites-enabled/calibre.conf dest: /etc/apache2/sites-enabled/calibre.conf
state: link state: link
when: calibre_enabled and is_debuntu 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: file:
dest: /etc/apache2/sites-enabled/calibre.conf dest: /etc/apache2/sites-enabled/calibre.conf
state: absent state: absent
when: (not calibre_enabled) and is_debuntu 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: service:
name: calibre-serve name: calibre-serve
enabled: yes enabled: yes
@ -126,14 +125,14 @@
#async: 900 #async: 900
#poll: 5 #poll: 5
- name: Forcing apache to reread configs - name: Reload Apache
service: systemd:
name: "{{ apache_service }}" name: "{{ apache_service }}"
state: reloaded state: reloaded
- name: Add 'calibre' to list of services at {{ iiab_ini_file }} - name: Add 'calibre' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: calibre section: calibre
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"