mirror of
https://github.com/iiab/iiab.git
synced 2025-02-13 11:42:08 +00:00
commit
866ca41e20
6 changed files with 31 additions and 13 deletions
|
@ -3,7 +3,7 @@
|
||||||
path: /etc/cloud/cloud.cfg
|
path: /etc/cloud/cloud.cfg
|
||||||
register: U18_server
|
register: U18_server
|
||||||
|
|
||||||
- name: edit cloud.cfg yaml
|
- name: Edit cloud.cfg yaml
|
||||||
lineinfile:
|
lineinfile:
|
||||||
dest: /etc/cloud/cloud.cfg
|
dest: /etc/cloud/cloud.cfg
|
||||||
regexp: '^preserve_hostname*'
|
regexp: '^preserve_hostname*'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# workaround for fact that auto create does not work on ini_file
|
# 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:
|
file:
|
||||||
dest: "{{ iiab_config_file }}"
|
dest: "{{ iiab_config_file }}"
|
||||||
state: touch
|
state: touch
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
- option: iiab_dir
|
- option: iiab_dir
|
||||||
value: "{{ iiab_dir }}"
|
value: "{{ iiab_dir }}"
|
||||||
|
|
||||||
- name: add version section
|
- name: Add version section
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "{{ iiab_config_file }}"
|
dest: "{{ iiab_config_file }}"
|
||||||
section: version
|
section: version
|
||||||
|
|
|
@ -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
|
# In addition to: http://box:8080 http://box/books box/libros box/livres box/livros box/liv
|
||||||
|
|
||||||
calibre_dbpath: "{{ content_base }}/calibre"
|
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"
|
calibre_sample_book: "Metamorphosis-jackson.epub"
|
||||||
# Must be downloadable from http://download.iiab.io/packages
|
# 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 testing branch for Ubuntu 16.04: scripts/calibre-install-latest.sh
|
||||||
# - run unstable branch for Debian etc: scripts/calibre-install-unstable.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:
|
template:
|
||||||
src: "{{ item.src }}"
|
src: "{{ item.src }}"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
|
@ -40,15 +49,17 @@
|
||||||
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'}
|
||||||
|
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:
|
systemd:
|
||||||
daemon_reload: yes
|
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)
|
# 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
|
Type=forking
|
||||||
PIDFile=/var/run/calibre.pid
|
PIDFile=/var/run/calibre.pid
|
||||||
TimeoutStartSec=400
|
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]
|
[Install]
|
||||||
TimeoutStartSec=900
|
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