1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/calibre/tasks/create-db.yml

36 lines
1.1 KiB
YAML
Raw Normal View History

2017-11-19 19:53:41 +00:00
- name: Create /library/calibre (mandatory since Calibre 3.x)
file:
path: "{{ calibre_dbpath }}"
state: directory
2017-11-20 07:57:05 +00:00
#mode: 0755
2017-11-19 19:53:41 +00:00
- name: Check if sample book exists in /opt/iiab/downloads
stat:
path: "{{ content_base }}/downloads/{{ calibre_sample_book }}"
register: sample_bk
- name: Download sample book (mandatory since Calibre 3.x)
get_url:
url: "{{ iiab_download_url }}/{{ calibre_sample_book }}"
dest: "{{ content_base }}/downloads"
when: internet_available and not sample_bk.stat.exists
- name: Check if sample book exists in /opt/iiab/downloads
stat:
path: "{{ content_base }}/downloads/{{ calibre_sample_book }}"
register: sample_bk
- name: Incorporate sample book into Calibre DB (mandatory since Calibre 3.x)
shell: "calibredb add {{ content_base }}/downloads/{{ calibre_sample_book }} --with-library {{ calibre_dbpath }}"
when: sample_bk.stat.exists
2017-11-20 01:17:37 +00:00
- name: Make /library/calibre/metadata.db writable for Calibre client SW
2017-11-20 01:17:37 +00:00
file:
path: "{{ calibre_dbpath }}/metadata.db"
2017-11-20 08:16:05 +00:00
mode: "ugo+w"
#mode: 0666
2017-11-20 07:57:05 +00:00
#owner: pi
#group: pi
#owner: iiab-admin
#group: iiab-admin