mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 03:32:12 +00:00
commit
866ca41e20
6 changed files with 31 additions and 13 deletions
|
@ -3,7 +3,7 @@
|
|||
path: /etc/cloud/cloud.cfg
|
||||
register: U18_server
|
||||
|
||||
- name: edit cloud.cfg yaml
|
||||
- name: Edit cloud.cfg yaml
|
||||
lineinfile:
|
||||
dest: /etc/cloud/cloud.cfg
|
||||
regexp: '^preserve_hostname*'
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# workaround for fact that auto create does not work on ini_file
|
||||
- name: Create iiab config file
|
||||
- name: Create /etc/iiab/iiab.ini (iiab_config_file)
|
||||
file:
|
||||
dest: "{{ iiab_config_file }}"
|
||||
state: touch
|
||||
|
@ -16,12 +16,12 @@
|
|||
- option: iiab_dir
|
||||
value: "{{ iiab_dir }}"
|
||||
|
||||
- name: add version section
|
||||
- name: Add version section
|
||||
ini_file:
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: version
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
dest: "{{ iiab_config_file }}"
|
||||
section: version
|
||||
option: "{{ item.option }}"
|
||||
value: "{{ item.value }}"
|
||||
with_items:
|
||||
- option: distribution
|
||||
value: "{{ ansible_distribution }}"
|
||||
|
|
|
@ -5,7 +5,14 @@ calibre_web_path: calibre
|
|||
# In addition to: http://box:8080 http://box/books box/libros box/livres box/livros box/liv
|
||||
|
||||
calibre_dbpath: "{{ content_base }}/calibre"
|
||||
# i.e. /library/calibre
|
||||
# i.e. /library/calibre (holds metadata.db + book directories + our users.sqlite)
|
||||
|
||||
calibre_userdb: "{{ calibre_dbpath }}/users.sqlite"
|
||||
# i.e. /library/calibre/users.sqlite since github.com/iiab/iiab/issues/830
|
||||
# Teachers add/remove/convert books & edit metadata using: Admin/changeme
|
||||
# Stub/Student acnts to browse: box/box, h/h, ht/ht, m/m, mx/mx, p/p, pe/pe
|
||||
# Edit accounts/permissions using:
|
||||
# calibre-server --manage-users --userdb /library/calibre/users.sqlite
|
||||
|
||||
calibre_sample_book: "Metamorphosis-jackson.epub"
|
||||
# Must be downloadable from http://download.iiab.io/packages
|
||||
|
|
|
@ -32,7 +32,16 @@
|
|||
# - run testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh
|
||||
# - run unstable branch for Debian etc: scripts/calibre-install-unstable.sh
|
||||
|
||||
- name: Create calibre-serve.service and calibre.conf
|
||||
- name: Copy template userdb to /library/calibre/users.sqlite (IF /usr/bin/calibre WAS MISSING)
|
||||
copy:
|
||||
src: /opt/iiab/iiab/roles/calibre/templates/users.sqlite
|
||||
dest: "{{ calibre_userdb }}"
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: (not calib_executable.stat.exists)
|
||||
|
||||
- name: Create calibre-serve.service and calibre.conf (IF /usr/bin/calibre WAS MISSING)
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
|
@ -40,15 +49,17 @@
|
|||
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'}
|
||||
when: (not calib_executable.stat.exists)
|
||||
|
||||
- name: Force systemd to reread configs
|
||||
- name: Force systemd to reread configs (IF /usr/bin/calibre WAS MISSING)
|
||||
systemd:
|
||||
daemon_reload: yes
|
||||
when: calibre_config.changed
|
||||
when: (not calib_executable.stat.exists)
|
||||
# when: calibre_config.changed
|
||||
|
||||
# 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ After=syslog.target network.target local-fs.target
|
|||
Type=forking
|
||||
PIDFile=/var/run/calibre.pid
|
||||
TimeoutStartSec=400
|
||||
ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} {{ calibre_dbpath }}
|
||||
ExecStart=/usr/bin/calibre-server --daemonize --log=/var/log/calibre.log --pidfile=/var/run/calibre.pid --port={{ calibre_port }} --enable-auth --userdb={{ calibre_userdb }} {{ calibre_dbpath }}
|
||||
|
||||
[Install]
|
||||
TimeoutStartSec=900
|
||||
|
|
BIN
roles/calibre/templates/users.sqlite
Normal file
BIN
roles/calibre/templates/users.sqlite
Normal file
Binary file not shown.
Loading…
Reference in a new issue