1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Ansible chucks based on -

This commit is contained in:
Arky 2018-08-14 10:29:19 +07:00
parent a6de9dee76
commit f9548e30d6
5 changed files with 43 additions and 43 deletions

View file

@ -50,7 +50,7 @@ Backup Content
-------------- --------------
Calibre-web stores its configuration into SQLite database file /library/calibre-web/metadata.db. Calibre-web stores its configuration into SQLite database file /library/calibre-web/metadata.db.
The content is stored in various folders under /library/calibre-web. Please backup the files before The content is stored in various folders under /library/calibre-web. Please backup the files before
upgrading. Also set calibre-web_provision varilable to False before upgrading. upgrading. Also set calibre_web_provision varilable to False before upgrading.
Known Issues Known Issues
------------ ------------

View file

@ -2,24 +2,24 @@
# To override them edit /etc/iiab/local_vars.yml # To override them edit /etc/iiab/local_vars.yml
# Installation Variables # Installation Variables
calibre-web_install: False calibre_web_install: False
calibre-web_enabled: False calibre_web_enabled: False
# calibre-web folder to store its data and configuration files. # calibre-web folder to store its data and configuration files.
calibre-web_home: "{{ content_base }}/calibre-web" calibre_web_home: "{{ content_base }}/calibre-web"
calibre-web_http_port: 8083 calibre_web_http_port: 8083
calibre-web_url: /calibre-web calibre_web_url: /calibre-web
calibre-web_path: "{{ iiab_base }}/calibre-web" calibre_web_path: "{{ iiab_base }}/calibre-web"
calibre-web_exec_path: "{{ calibre-web_path }}/cps.py" calibre_web_exec_path: "{{ calibre_web_path }}/cps.py"
# Calibre-web setup will be provisioned with default administration account, metadata.db and # Calibre-web setup will be provisioned with default administration account, metadata.db and
# language. You could turn this to 'False' while reinstalling/upgrading calibre-web. # language. You could turn this to 'False' while reinstalling/upgrading calibre-web.
calibre-web_provision: True calibre_web_provision: True
#calibre-web system user #calibre-web system user
calibre-web_user: root calibre_web_user: root
# calibre-web admin account # calibre_web admin account
# calibre-web_admin_user: admin # calibre_web_admin_user: admin
# calibre-web_admin_password: admin123 # calibre_web_admin_password: admin123

View file

@ -1,34 +1,34 @@
- name: Create calibre-web folders to store data and configuration files. - name: Create calibre-web folders to store data and configuration files.
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: "{{ calibre-web_user }}" owner: "{{ calibre_web_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
mode: 0755 mode: 0755
state: directory state: directory
with_items: with_items:
- "{{ calibre-web_home }}" - "{{ calibre_web_home }}"
- "{{ calibre-web_path }}" - "{{ calibre_web_path }}"
- name: Download calibre-web github repository. - name: Download calibre-web github repository.
git: git:
repo: https://github.com/janeczku/calibre-web.git repo: https://github.com/janeczku/calibre-web.git
dest: "{{ calibre-web_path }}" dest: "{{ calibre_web_path }}"
update: yes update: yes
version: master version: master
when: internet_available when: internet_available
- name: Download calibre-web dependencies into vendor subdirectory. - name: Download calibre-web dependencies into vendor subdirectory.
pip: pip:
requirements: "{{ calibre-web_path }}/requirements.txt" requirements: "{{ calibre_web_path }}/requirements.txt"
extra_args: "--target vendor --no-cache-dir" extra_args: "--target vendor --no-cache-dir"
chdir: "{{ calibre-web_path }}" chdir: "{{ calibre_web_path }}"
- name: Create calibre-web systemd service unit and httpd2 configuration. - name: Create calibre-web systemd service unit and httpd2 configuration.
template: template:
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
owner: "{{ calibre-web_user }}" owner: "{{ calibre_web_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
with_items: with_items:
- { src: 'calibre-web.service.j2', dest: '/etc/systemd/system/calibre-web.service', mode: '0644' } - { src: 'calibre-web.service.j2', dest: '/etc/systemd/system/calibre-web.service', mode: '0644' }
@ -39,11 +39,11 @@
src: "{{ item.src }}" src: "{{ item.src }}"
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
mode: "{{ item.mode }}" mode: "{{ item.mode }}"
owner: "{{ calibre-web_user }}" owner: "{{ calibre_web_user }}"
group: "{{ apache_user }}" group: "{{ apache_user }}"
with_items: with_items:
- { src: 'metadata.db', dest: '{{ calibre-web_home }}/metadata.db', mode: '0644' } - { src: 'metadata.db', dest: '{{ calibre_web_home }}/metadata.db', mode: '0644' }
when: calibre-web_provision when: calibre_web_provision
- name: Ask systemd to reread unit files (daemon-reload). - name: Ask systemd to reread unit files (daemon-reload).
systemd: systemd:
@ -54,30 +54,30 @@
name: calibre-web name: calibre-web
enabled: yes enabled: yes
state: restarted state: restarted
when: calibre-web_enabled when: calibre_web_enabled
- name: Enable calibre-web httpd2 site - name: Enable calibre-web httpd2 site
command: a2ensite calibre-web.conf command: a2ensite calibre-web.conf
when: calibre-web_enabled when: calibre_web_enabled
- name: Restart Apache after enabling calibre-web httpd2 site. - name: Restart Apache after enabling calibre-web httpd2 site.
command: apachectl -k graceful command: apachectl -k graceful
when: calibre-web_enabled when: calibre_web_enabled
- name: Disable calibre-web service. - name: Disable calibre-web service.
service: service:
name: calibre-web name: calibre-web
enabled: no enabled: no
state: stopped state: stopped
when: not calibre-web_enabled when: not calibre_web_enabled
- name: Disable calibre-web httpd2 site. - name: Disable calibre-web httpd2 site.
command: a2dissite calibre-web.conf command: a2dissite calibre-web.conf
when: not calibre-web_enabled when: not calibre_web_enabled
- name: Restart Apache after disabling calibre-web httpd2 site. - name: Restart Apache after disabling calibre-web httpd2 site.
command: apachectl -k graceful command: apachectl -k graceful
when: not calibre-web_enabled when: not calibre_web_enabled
- name: Add 'calibre-web' to list of services at /etc/iiab/iiab.ini - name: Add 'calibre-web' to list of services at /etc/iiab/iiab.ini
ini_file: ini_file:
@ -90,13 +90,13 @@
value: calibre-web value: calibre-web
- option: description - option: description
value: '"calibre-web is a web app providing a clean interface for browsing, reading and downloading eBooks."' value: '"calibre-web is a web app providing a clean interface for browsing, reading and downloading eBooks."'
- option: calibre-web_url - option: calibre_web_url
value: "{{ calibre-web_url }}" value: "{{ calibre_web_url }}"
- option: calibre-web_path - option: calibre-web_path
value: "{{ calibre-web_path }}" value: "{{ calibre_web_path }}"
- option: calibre-web_port - option: calibre_web_port
value: "{{ calibre-web_http_port }}" value: "{{ calibre_web_http_port }}"
- option: enabled - option: enabled
value: "{{ calibre-web_enabled }}" value: "{{ calibre_web_enabled }}"
- option: True - option: True
value: "{{ calibre-web_provision }}" value: "{{ calibre_web_provision }}"

View file

@ -1,8 +1,8 @@
<VirtualHost *:80> <VirtualHost *:80>
<Location "{{ calibre-web_url }}" > <Location "{{ calibre_web_url }}" >
RequestHeader set X-SCRIPT-NAME {{ calibre-web_url }} RequestHeader set X-SCRIPT-NAME {{ calibre_web_url }}
RequestHeader set X-SCHEME http RequestHeader set X-SCHEME http
ProxyPass http://localhost:{{ calibre-web_http_port }}/ ProxyPass http://localhost:{{ calibre_web_http_port }}/
ProxyPassReverse http://localhost:{{ calibre-web_http_port }}/ ProxyPassReverse http://localhost:{{ calibre_web_http_port }}/
</Location> </Location>
</VirtualHost> </VirtualHost>

View file

@ -2,9 +2,9 @@ Description=Calibre-Web
[Service] [Service]
Type=simple Type=simple
User={{ calibre-web_user }} User={{ calibre_web_user }}
ExecStart=/usr/bin/python " {{ calibre-web_exec_path }} " ExecStart=/usr/bin/python " {{ calibre_web_exec_path }} "
WorkingDirectory={{ calibre-web_path }} WorkingDirectory={{ calibre_web_path }}
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target