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

Update kiwix_install.yml

This commit is contained in:
A Holt 2018-10-31 01:42:27 -04:00 committed by GitHub
parent 9dc04dc925
commit 22b8671f3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
# 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE # 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE
- name: Create various directories for Kiwix ZIM files - name: Create directory {{ iiab_zim_path }} and subdirs {content, index} for Kiwix ZIM files
file: file:
path: "{{ item }}" path: "{{ item }}"
owner: root owner: root
@ -12,12 +12,12 @@
- "{{ iiab_zim_path }}/content" - "{{ iiab_zim_path }}/content"
- "{{ iiab_zim_path }}/index" - "{{ iiab_zim_path }}/index"
- name: Check for /library/zims/library.xml - name: Check for {{ kiwix_library_xml }} # /library/zims/library.xml
stat: stat:
path: "{{ kiwix_library_xml }}" path: "{{ kiwix_library_xml }}"
register: kiwix_xml register: kiwix_xml
- name: Place a stub /library/zims/library.xml if file does not exist - name: Install a stub /library/zims/library.xml if one doesn't exist
template: template:
src: "{{ item }}" src: "{{ item }}"
dest: "{{ kiwix_library_xml }}" dest: "{{ kiwix_library_xml }}"
@ -34,12 +34,12 @@
path: "{{ kiwix_path }}/bin/kiwix-serve" path: "{{ kiwix_path }}/bin/kiwix-serve"
register: kiwix_bin register: kiwix_bin
- name: Set kiwix_force_install if kiwix-serve not found - name: Set fact kiwix_force_install if kiwix-serve not found
set_fact: set_fact:
kiwix_force_install: True kiwix_force_install: True
when: not kiwix_bin.stat.exists when: not kiwix_bin.stat.exists
- name: Copy test.zim file if kiwix_force_install - name: Install {{ iiab_zim_path }}/content/test.zim if kiwix_force_install
copy: copy:
src: test.zim src: test.zim
dest: "{{ iiab_zim_path }}/content/test.zim" dest: "{{ iiab_zim_path }}/content/test.zim"
@ -49,7 +49,7 @@
force: no force: no
when: kiwix_force_install when: kiwix_force_install
- name: Create /opt/iiab/kiwix/bin directory - name: Create {{ kiwix_path }}/bin directory # /opt/iiab/kiwix/bin
file: file:
path: "{{ kiwix_path }}/bin" path: "{{ kiwix_path }}/bin"
owner: root owner: root
@ -59,7 +59,7 @@
# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install
- name: Unarchive kiwix-tools .tar.gz to /tmp - name: Unarchive {{ kiwix_src_file }} to /tmp # e.g. kiwix-tools_linux-armhf-0.6.1-1.tar.gz
unarchive: unarchive:
src: "{{ downloads_dir }}/{{ kiwix_src_file }}" src: "{{ downloads_dir }}/{{ kiwix_src_file }}"
dest: /tmp dest: /tmp
@ -73,7 +73,7 @@
# 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU # 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU
- name: Enable the mods which permit Apache to proxy (debuntu) - name: Enable the 4 mods which permit Apache to proxy (debuntu)
apache2_module: apache2_module:
name: "{{ item }}" name: "{{ item }}"
with_items: with_items:
@ -85,7 +85,7 @@
# 4. CREATE/ENABLE/RESTART (OR DISABLE) KIWIX SERVICE & ITS CRON JOB # 4. CREATE/ENABLE/RESTART (OR DISABLE) KIWIX SERVICE & ITS CRON JOB
- name: Create 'kiwix-serve' service and related files - name: 'Install from templates: kiwix-serve.service, iiab-make-kiwix-lib, iiab-make-kiwix-lib.py, kiwix.conf'
template: template:
backup: no backup: no
src: "{{ item.src }}" src: "{{ item.src }}"
@ -101,14 +101,14 @@
# - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'} # - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'}
- { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'} - { src: 'kiwix.conf.j2', dest: '/etc/{{ apache_config_dir }}/kiwix.conf', mode: '0644'}
- name: Enable Kiwix Proxy in Apache - is disabled by turning off kiwix service (debuntu) - name: Create softlink kiwix.conf from sites-enabled to sites-available - for Kiwix Proxy in Apache - is disabled by turning off service kiwix-serve (debuntu)
file: file:
src: /etc/apache2/sites-available/kiwix.conf src: /etc/apache2/sites-available/kiwix.conf
path: /etc/apache2/sites-enabled/kiwix.conf path: /etc/apache2/sites-enabled/kiwix.conf
state: link state: link
when: is_debuntu when: is_debuntu
- name: Enable 'kiwix-serve' service - name: Enable & Restart 'kiwix-serve' service
service: service:
name: kiwix-serve name: kiwix-serve
enabled: yes enabled: yes
@ -149,9 +149,9 @@
# 5. FINALIZE # 5. FINALIZE
- name: Add 'kiwix' to list of services at {{ iiab_ini_file }} - name: Add 'kiwix' variable values to {{ iiab_ini_file }}
ini_file: ini_file:
dest: "{{ iiab_ini_file }}" path: "{{ iiab_ini_file }}"
section: kiwix section: kiwix
option: "{{ item.option }}" option: "{{ item.option }}"
value: "{{ item.value }}" value: "{{ item.value }}"