mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
Remove "| bool" 1.5yrs later, as Ansible 2.10 changed conditional_bare_variables default
This commit is contained in:
parent
2968a8a20e
commit
ca171fbc1c
158 changed files with 2072 additions and 2072 deletions
|
|
@ -1,8 +1,8 @@
|
|||
Make zim with
|
||||
|
||||
./zimwriterfs --welcome=index.html --favicon=favicon.png --language=eng --title=test --description=test --creator=XSCE --publisher=XSCE /root/devel/test_zim test.zim
|
||||
|
||||
Create library.xml with
|
||||
|
||||
/opt/schoolserver/kiwix/bin/kiwix-manage /library/zims/library.xml add /library/zims/content/test.zim
|
||||
|
||||
Make zim with
|
||||
|
||||
./zimwriterfs --welcome=index.html --favicon=favicon.png --language=eng --title=test --description=test --creator=XSCE --publisher=XSCE /root/devel/test_zim test.zim
|
||||
|
||||
Create library.xml with
|
||||
|
||||
/opt/schoolserver/kiwix/bin/kiwix-manage /library/zims/library.xml add /library/zims/content/test.zim
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
- name: Enable http://box{{ kiwix_url }} via Apache # http://box/kiwix
|
||||
command: a2ensite kiwix.conf
|
||||
when: kiwix_enabled | bool
|
||||
when: kiwix_enabled
|
||||
|
||||
- name: Disable http://box{{ kiwix_url }} via Apache # http://box/kiwix
|
||||
command: a2dissite kiwix.conf
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
daemon_reload: yes
|
||||
enabled: yes
|
||||
state: restarted
|
||||
when: kiwix_enabled | bool
|
||||
when: kiwix_enabled
|
||||
|
||||
- name: Disable & Stop 'kiwix-serve' systemd service
|
||||
systemd:
|
||||
|
|
@ -42,4 +42,4 @@
|
|||
|
||||
- name: Enable/Disable/Restart NGINX if primary
|
||||
include_tasks: nginx.yml
|
||||
when: nginx_enabled | bool
|
||||
when: nginx_enabled
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
url: "{{ iiab_download_url }}/{{ kiwix_src_file }}" # http://download.iiab.io/packages
|
||||
dest: "{{ downloads_dir }}/{{ kiwix_src_file }}"
|
||||
timeout: "{{ download_timeout }}"
|
||||
when: internet_available | bool
|
||||
when: internet_available
|
||||
|
||||
- name: Create dir {{ iiab_zim_path }} and subdirs {content, index} for Kiwix ZIM files
|
||||
file:
|
||||
|
|
@ -95,7 +95,7 @@
|
|||
# - proxy_html
|
||||
# - proxy_http
|
||||
# - rewrite
|
||||
# when: is_debuntu | bool
|
||||
# when: is_debuntu
|
||||
|
||||
|
||||
# 4. INSTALL iiab-make-kiwix-lib*, kiwix-serve.service, kiwix.conf for Apache
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
# Install kiwix android app apk for downloading
|
||||
- name: Create {{ doc_root }}{{ kiwix_apk_url }} directory
|
||||
file:
|
||||
path: "{{ doc_root }}{{ kiwix_apk_url }}"
|
||||
state: directory
|
||||
|
||||
- name: Download kiwix.apk to {{ doc_root }}{{ kiwix_apk_url }}
|
||||
get_url:
|
||||
url: "{{ kiwix_apk_src }}" # https://download.kiwix.org/release/kiwix-android/kiwix.apk
|
||||
dest: "{{ doc_root }}{{ kiwix_apk_url }}"
|
||||
timeout: "{{ download_timeout }}"
|
||||
when: internet_available | bool
|
||||
|
||||
- name: Symlink {{ doc_root }}{{ kiwix_apk_url }}/zims -> {{ iiab_zim_path }}/content
|
||||
file:
|
||||
src: "{{ iiab_zim_path }}/content" # /library/zims/content
|
||||
path: "{{ doc_root }}{{ kiwix_apk_url }}/zims" # /library/www/html/softare/kiwix/zims
|
||||
state: link
|
||||
# Install kiwix android app apk for downloading
|
||||
- name: Create {{ doc_root }}{{ kiwix_apk_url }} directory
|
||||
file:
|
||||
path: "{{ doc_root }}{{ kiwix_apk_url }}"
|
||||
state: directory
|
||||
|
||||
- name: Download kiwix.apk to {{ doc_root }}{{ kiwix_apk_url }}
|
||||
get_url:
|
||||
url: "{{ kiwix_apk_src }}" # https://download.kiwix.org/release/kiwix-android/kiwix.apk
|
||||
dest: "{{ doc_root }}{{ kiwix_apk_url }}"
|
||||
timeout: "{{ download_timeout }}"
|
||||
when: internet_available
|
||||
|
||||
- name: Symlink {{ doc_root }}{{ kiwix_apk_url }}/zims -> {{ iiab_zim_path }}/content
|
||||
file:
|
||||
src: "{{ iiab_zim_path }}/content" # /library/zims/content
|
||||
path: "{{ doc_root }}{{ kiwix_apk_url }}/zims" # /library/www/html/softare/kiwix/zims
|
||||
state: link
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
template:
|
||||
src: kiwix-nginx.conf.j2
|
||||
dest: "{{ nginx_conf_dir }}/kiwix-nginx.conf" # /etc/nginx/conf.d
|
||||
when: kiwix_enabled | bool
|
||||
when: kiwix_enabled
|
||||
|
||||
- name: Disable http://box{{ kiwix_url }} via NGINX, by removing {{ nginx_conf_dir }}/kiwix-nginx.conf # http://box/kiwix
|
||||
file:
|
||||
|
|
|
|||
|
|
@ -1,33 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
LOCK_PATH=/run/lock/kiwix
|
||||
mkdir -p $LOCK_PATH
|
||||
|
||||
WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK";
|
||||
RUNLOCK="$LOCK_PATH/kiwix-lib-access.LCK";
|
||||
KIWIXLIB={{ kiwix_library_xml }}
|
||||
|
||||
exec 200>$WAITLOCK;
|
||||
exec 201>$RUNLOCK;
|
||||
|
||||
if flock -n -e 200; then :
|
||||
echo 'Waiting to run iiab-make-kiwix-lib.py'
|
||||
# wait for up to 5 min
|
||||
flock -x -w 300 201
|
||||
flock -u 200 # unlock queue
|
||||
echo "Now running iiab-make-kiwix-lib.py"
|
||||
# write to {{ kiwix_library_xml }}.tmp to minimize kiwix down
|
||||
# zim map could be out of sync for a few seconds
|
||||
# using new version that does deltas
|
||||
cp $KIWIXLIB $KIWIXLIB.tmp
|
||||
/usr/bin/iiab-make-kiwix-lib.py
|
||||
{{ systemctl_program }} stop kiwix-serve
|
||||
rm $KIWIXLIB
|
||||
mv $KIWIXLIB.tmp $KIWIXLIB
|
||||
{{ systemctl_program }} start kiwix-serve
|
||||
else
|
||||
echo "Can't get wait lock for iiab-make-kiwix-lib.py";
|
||||
exit 1;
|
||||
fi
|
||||
echo 'Finished making Kiwix library.xml'
|
||||
exit 0
|
||||
#!/bin/bash
|
||||
|
||||
LOCK_PATH=/run/lock/kiwix
|
||||
mkdir -p $LOCK_PATH
|
||||
|
||||
WAITLOCK="$LOCK_PATH/make-kiwix-lib-wait.LCK";
|
||||
RUNLOCK="$LOCK_PATH/kiwix-lib-access.LCK";
|
||||
KIWIXLIB={{ kiwix_library_xml }}
|
||||
|
||||
exec 200>$WAITLOCK;
|
||||
exec 201>$RUNLOCK;
|
||||
|
||||
if flock -n -e 200; then :
|
||||
echo 'Waiting to run iiab-make-kiwix-lib.py'
|
||||
# wait for up to 5 min
|
||||
flock -x -w 300 201
|
||||
flock -u 200 # unlock queue
|
||||
echo "Now running iiab-make-kiwix-lib.py"
|
||||
# write to {{ kiwix_library_xml }}.tmp to minimize kiwix down
|
||||
# zim map could be out of sync for a few seconds
|
||||
# using new version that does deltas
|
||||
cp $KIWIXLIB $KIWIXLIB.tmp
|
||||
/usr/bin/iiab-make-kiwix-lib.py
|
||||
{{ systemctl_program }} stop kiwix-serve
|
||||
rm $KIWIXLIB
|
||||
mv $KIWIXLIB.tmp $KIWIXLIB
|
||||
{{ systemctl_program }} start kiwix-serve
|
||||
else
|
||||
echo "Can't get wait lock for iiab-make-kiwix-lib.py";
|
||||
exit 1;
|
||||
fi
|
||||
echo 'Finished making Kiwix library.xml'
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue