From 2f59c60325033562d0a974e93de95cd10dedecc0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:04:45 -0500 Subject: [PATCH 01/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 73101d39b..6eb8b5607 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -57,7 +57,7 @@ mode: 0755 state: directory -# 2. INSTALL KIWIX-TOOLS EXECUTABLES: we get a whole web server for i686 but only the kiwix execs for linux64 & armhf +# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF 1ST PASS: we get a whole web server for i686 but only the kiwix execs for linux64 & armhf - name: Unarchive Kiwix to permanent location if 1st pass (bin_only, i.e. not i686) unarchive: @@ -95,7 +95,7 @@ # recurse: yes # mode: ???? -# 3. ENABLE MODS FOR APACHE PROXY +# 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU - name: Enable the mods which permit Apache to proxy (debuntu) apache2_module: From fb6d707c127aaba27e5bf89f1c7600f665f48de8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:09:47 -0500 Subject: [PATCH 02/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 6eb8b5607..c9e558601 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -42,7 +42,7 @@ - name: Copy test.zim file if 1st pass copy: src: test.zim - dest: "{{ kiwix_content_path }}/test.zim" + dest: "{{ iiab_zim_path }}/content/test.zim" mode: 0644 owner: root group: root From 19c1d2a9f3c7249c99e05f30277c0dee89b48882 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:10:54 -0500 Subject: [PATCH 03/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index c9e558601..cf72519a7 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -1,6 +1,6 @@ # 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE -- name: Create various directories for Kiwix's ZIM files +- name: Create various directories for Kiwix ZIM files file: path: "{{ item }}" owner: root From 2934c91784143016877b9e2f5b38299b7d071ee8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:19:16 -0500 Subject: [PATCH 04/42] kiwix_first_pass -> kiwix_force_install --- roles/kiwix/tasks/kiwix_install.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index cf72519a7..8599268dd 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -34,12 +34,12 @@ path: "{{ iiab_base }}/kiwix/bin/kiwix-serve" register: kiwix_bin -- name: Set kiwix_first_pass if kiwix-serve not found +- name: Set kiwix_force_install if kiwix-serve not found set_fact: - kiwix_first_pass: True + kiwix_force_install: True when: kiwix_bin.stat.exists is defined and not kiwix_bin.stat.exists -- name: Copy test.zim file if 1st pass +- name: Copy test.zim file if kiwix_force_install copy: src: test.zim dest: "{{ iiab_zim_path }}/content/test.zim" @@ -47,7 +47,7 @@ owner: root group: root force: no - when: kiwix_first_pass + when: kiwix_force_install - name: Create /opt/iiab/kiwix/bin directory file: @@ -57,33 +57,33 @@ mode: 0755 state: directory -# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF 1ST PASS: we get a whole web server for i686 but only the kiwix execs for linux64 & armhf +# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install: we get a whole web server for i686 but only the kiwix execs for linux64 & armhf -- name: Unarchive Kiwix to permanent location if 1st pass (bin_only, i.e. not i686) +- name: Unarchive Kiwix to permanent location (bin_only, i.e. not i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: "{{ iiab_base }}/kiwix/bin" owner: root group: root - when: kiwix_src_bin_only and kiwix_first_pass + when: kiwix_src_bin_only and kiwix_force_install # EXPERIMENTAL i686 CODE PATH: as of Nov 2017 bunzip2 then untar unpacks # to /tmp/kiwix-0.10-i686/bin WHOSE CONTENTS NEEDS TO BE MOVED TO # /opt/iiab/kiwix/bin (STANZA FURTHER BELOW). All i686 code needs testing. # ALSO: code below may need to be revived to chown -R root:root & chmod -- name: Unarchive kiwix-*-linux-i686.tar.bz2 to /tmp if 1st pass (not bin_only, i.e. i686) +- name: Unarchive kiwix-*-linux-i686.tar.bz2 to /tmp (not bin_only, i.e. i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp # dest: "{{ iiab_base }}" owner: root group: root - when: not kiwix_src_bin_only and kiwix_first_pass + when: not kiwix_src_bin_only and kiwix_force_install # EXPERIMENTAL i686 CODE PATH -- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin if 1st pass (not bin_only, i.e. i686) +- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (not bin_only, i.e. i686) shell: "mv /tmp/kiwix*i686/bin/* /opt/iiab/kiwix/bin/" - when: not kiwix_src_bin_only and kiwix_first_pass + when: not kiwix_src_bin_only and kiwix_force_install # MIGHT BE RESTORED LATER FOR i686? Unused as of Nov 2017: # # workaround because unarchive does not set ownership properly @@ -94,6 +94,7 @@ # group: root # recurse: yes # mode: ???? +# when: kiwix_force_install # 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU From 46a1a936f6e6d378f7e1cc9e7b535caba21ff7e5 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:31:53 -0500 Subject: [PATCH 05/42] Update main.yml --- roles/kiwix/defaults/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 5319c8812..b2ac7bb55 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -20,6 +20,7 @@ kiwix_library_xml: "{{ iiab_zim_path }}/library.xml" # Installation variables kiwix_install: True kiwix_enabled: True -kiwix_first_pass: False +# Move file /opt/iiab/kiwix/bin/kiwix-serve if you want to force a reinstall +kiwix_force_install: False # Unused as of Nov 2017: # kiwix_content_found: False From 9c78f51b5592d8fc37034f2b28bb6defcfa58d63 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:37:42 -0500 Subject: [PATCH 06/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 8599268dd..5967f363d 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -57,7 +57,8 @@ mode: 0755 state: directory -# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install: we get a whole web server for i686 but only the kiwix execs for linux64 & armhf +# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install +# (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) - name: Unarchive Kiwix to permanent location (bin_only, i.e. not i686) unarchive: From 6d201f4545ab58e722b5dbe6a8bc3e4e91b56ab8 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 12:52:48 -0500 Subject: [PATCH 07/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 5967f363d..7c598b461 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -72,7 +72,7 @@ # to /tmp/kiwix-0.10-i686/bin WHOSE CONTENTS NEEDS TO BE MOVED TO # /opt/iiab/kiwix/bin (STANZA FURTHER BELOW). All i686 code needs testing. # ALSO: code below may need to be revived to chown -R root:root & chmod -- name: Unarchive kiwix-*-linux-i686.tar.bz2 to /tmp (not bin_only, i.e. i686) +- name: Unarchive kiwix*i686.tar.bz2 to /tmp (not bin_only, i.e. i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp From 7c06a7e20abcfe8f35d87481e75fac3e34fb7f34 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 13:02:35 -0500 Subject: [PATCH 08/42] explain how to force i686 test on x86_64 (successful!) --- roles/kiwix/tasks/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index b0f745adf..d55284ff1 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -1,21 +1,21 @@ -# EXPERIMENTAL i686 CODE PATH -- name: "Set Kiwix filename to d/l: {{ kiwix_src_file_i686 }} (i686)" +- name: "Set Kiwix filename to d/l: {{ kiwix_src_file_armhf }} (armv6l or armv71)" set_fact: - kiwix_src_file: "{{ kiwix_src_file_i686 }}" - kiwix_src_bin_only: False - when: ansible_machine == "i686" - + kiwix_src_file: "{{ kiwix_src_file_armhf }}" + kiwix_src_bin_only: True + when: ansible_machine == "armv7l" or ansible_machine == "armv6l" + - name: "Set Kiwix filename to d/l: {{ kiwix_src_file_linux64 }} (x86_64)" set_fact: kiwix_src_file: "{{ kiwix_src_file_linux64 }}" kiwix_src_bin_only: True when: ansible_machine == "x86_64" -- name: "Set Kiwix filename to d/l: {{ kiwix_src_file_armhf }} (armv6l or armv71)" +- name: "Set Kiwix filename to d/l: {{ kiwix_src_file_i686 }} (i686)" set_fact: - kiwix_src_file: "{{ kiwix_src_file_armhf }}" - kiwix_src_bin_only: True - when: ansible_machine == "armv7l" or ansible_machine == "armv6l" + kiwix_src_file: "{{ kiwix_src_file_i686 }}" + kiwix_src_bin_only: False + when: ansible_machine == "i686" +# COMMENT OUT LINE ABOVE TO TEST OF i686 CODE PATH ON X86_64 (WORKS NOV 2017) - name: Download Kiwix software to /opt/iiab/downloads get_url: From eac542ff44d1331eb484425d9bae36311ab2b3fc Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 13:03:11 -0500 Subject: [PATCH 09/42] Update main.yml --- roles/kiwix/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index d55284ff1..a12a82ece 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -15,7 +15,7 @@ kiwix_src_file: "{{ kiwix_src_file_i686 }}" kiwix_src_bin_only: False when: ansible_machine == "i686" -# COMMENT OUT LINE ABOVE TO TEST OF i686 CODE PATH ON X86_64 (WORKS NOV 2017) +# COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) - name: Download Kiwix software to /opt/iiab/downloads get_url: From 388603c0722bee246118b5bb7279411ce2419630 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 15:36:12 -0500 Subject: [PATCH 10/42] stale comments removed (chown tested as unnec) --- roles/kiwix/tasks/kiwix_install.yml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 7c598b461..28f20a615 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -60,7 +60,7 @@ # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install # (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) -- name: Unarchive Kiwix to permanent location (bin_only, i.e. not i686) +- name: Unarchive Kiwix to permanent location (bin_only, i.e. NOT i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: "{{ iiab_base }}/kiwix/bin" @@ -68,11 +68,7 @@ group: root when: kiwix_src_bin_only and kiwix_force_install -# EXPERIMENTAL i686 CODE PATH: as of Nov 2017 bunzip2 then untar unpacks -# to /tmp/kiwix-0.10-i686/bin WHOSE CONTENTS NEEDS TO BE MOVED TO -# /opt/iiab/kiwix/bin (STANZA FURTHER BELOW). All i686 code needs testing. -# ALSO: code below may need to be revived to chown -R root:root & chmod -- name: Unarchive kiwix*i686.tar.bz2 to /tmp (not bin_only, i.e. i686) +- name: Unarchive kiwix*i686.tar.bz2 to /tmp (NOT bin_only, i.e. i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp @@ -81,22 +77,10 @@ group: root when: not kiwix_src_bin_only and kiwix_force_install -# EXPERIMENTAL i686 CODE PATH -- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (not bin_only, i.e. i686) +- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (NOT bin_only, i.e. i686) shell: "mv /tmp/kiwix*i686/bin/* /opt/iiab/kiwix/bin/" when: not kiwix_src_bin_only and kiwix_force_install -# MIGHT BE RESTORED LATER FOR i686? Unused as of Nov 2017: -# # workaround because unarchive does not set ownership properly -# - name: "Set ownership as if: 'chown -R root:root /opt/iiab/kiwix'" -# file: -# path: "{{ iiab_base }}/kiwix" -# owner: root -# group: root -# recurse: yes -# mode: ???? -# when: kiwix_force_install - # 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU - name: Enable the mods which permit Apache to proxy (debuntu) From c7a35c5502f84e16947507696c05905ed8820470 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 15:37:55 -0500 Subject: [PATCH 11/42] Update main.yml --- roles/kiwix/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index b2ac7bb55..37b282bef 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -6,7 +6,7 @@ kiwix_src_file_i686: "kiwix-0.10-linux-i686.tar.bz2" # Appears to be kiwix-0.9 from May 2014: # kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" -# The following 2 lines are unused as of Nov 2017: +# The following 2 lines are unused: (Nov 2017) # kiwix_url: /kiwix # kiwix_path: "{{ iiab_base }}/kiwix" kiwix_port: 3000 From c02ef95c31e1abd55681564615f090d15703bcca Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 15:38:33 -0500 Subject: [PATCH 12/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 28f20a615..6acff9fcf 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -156,7 +156,7 @@ value: kiwix-serve - option: description value: '"Part of https://github.com/kiwix/kiwix-tools/ - kiwix-serve is the most used web server for ZIM files."' -# The following 4 lines are unused as of Nov 2017: +# The following 4 lines are unused: (Nov 2017) # - option: kiwix_url # value: "{{ kiwix_url }}" # - option: kiwix_path @@ -167,7 +167,7 @@ value: "{{ iiab_zim_path }}" - option: kiwix_library_xml value: "{{ kiwix_library_xml }}" -# The following 2 lines are unused as of Nov 2017: +# The following 2 lines are unused: (Nov 2017) # - option: kiwix_content_path # value: "{{ kiwix_content_path }}" - option: enabled From 2822b3c302ee788aaa7e4d6388d87fa5b029fe02 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 15:49:13 -0500 Subject: [PATCH 13/42] Update main.yml --- roles/kiwix/defaults/main.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 37b282bef..3bb711c68 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -3,24 +3,27 @@ kiwix_src_file_linux64: "kiwix-tools_linux64_2017-11-12.tar.gz" kiwix_src_file_armhf: "kiwix-tools_armhf_2017-11-12.tar.gz" # Experimental kiwix-0.10 from Oct 2016: (to be replaced before Feb 2018, SEE https://github.com/kiwix/kiwix-build/issues/94) kiwix_src_file_i686: "kiwix-0.10-linux-i686.tar.bz2" -# Appears to be kiwix-0.9 from May 2014: +# Also consider kiwix-0.9 from May 2014: (during content testing!) # kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" +kiwix_port: 3000 # The following 2 lines are unused: (Nov 2017) # kiwix_url: /kiwix # kiwix_path: "{{ iiab_base }}/kiwix" -kiwix_port: 3000 -# /library/zims contains 3 important things: {library.xml, content, index} +# /library/zims contains 3 important things: +# - library.xml +# - content directory for all *.zim's +# - index directory for legacy *.zim.idx's iiab_zim_path: "{{ content_base }}/zims" kiwix_library_xml: "{{ iiab_zim_path }}/library.xml" -# Unused as of Nov 2017: +# Unused: (Nov 2017) # kiwix_content_path: "{{ iiab_zim_path }}/content" -# Installation variables +# Installation Variables kiwix_install: True kiwix_enabled: True -# Move file /opt/iiab/kiwix/bin/kiwix-serve if you want to force a reinstall +# MOVE FILE /opt/iiab/kiwix/bin/kiwix-serve TO FORCE A REINSTALL OF kiwix-tools kiwix_force_install: False -# Unused as of Nov 2017: +# Unused: (Nov 2017) # kiwix_content_found: False From e7e7680bede627c0139799d38c58924b933cb3ed Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:03:52 -0500 Subject: [PATCH 14/42] Update main.yml --- roles/kiwix/defaults/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 3bb711c68..556431ceb 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -1,10 +1,9 @@ # Which kiwix-tools to download from http://download.iiab.io/packages/ (origin: http://download.kiwix.org/nightly/) -kiwix_src_file_linux64: "kiwix-tools_linux64_2017-11-12.tar.gz" kiwix_src_file_armhf: "kiwix-tools_armhf_2017-11-12.tar.gz" -# Experimental kiwix-0.10 from Oct 2016: (to be replaced before Feb 2018, SEE https://github.com/kiwix/kiwix-build/issues/94) -kiwix_src_file_i686: "kiwix-0.10-linux-i686.tar.bz2" -# Also consider kiwix-0.9 from May 2014: (during content testing!) -# kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" +kiwix_src_file_linux64: "kiwix-tools_linux64_2017-11-12.tar.gz" +kiwix_src_file_i686: "kiwix-0.10-linux-i686.tar.bz2" # Published Oct 2016 ("experimental") +# kiwix_src_file_i686: "kiwix-linux-i686.tar.bz2" # Published May 2014 ("use v0.9 to test legacy ZIM content") +# KIWIX FOR i686 SHOULD BE REPLACED BEFORE FEB 2018: https://github.com/kiwix/kiwix-build/issues/94 kiwix_port: 3000 # The following 2 lines are unused: (Nov 2017) From 771dda2db85993abb47696f88df3788fec19220e Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:05:26 -0500 Subject: [PATCH 15/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 6acff9fcf..9b7cf8f32 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -126,7 +126,7 @@ # In the past kiwix-serve did not stay running, so we'd been doing this hourly. # @mgautierfr & others suggest kiwix-serve might be auto-restarted w/o cron in -# future, whenever service fails, if this really catches all cases? +# future, whenever service fails, if this really catches all cases?? # https://github.com/iiab/iiab/issues/484#issuecomment-342151726 - name: Make a crontab entry to restart kiwix-serve at 4AM (debuntu) lineinfile: From f9d9f5746d19866d873c16c19e1252f0d4c76945 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:14:44 -0500 Subject: [PATCH 16/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 9b7cf8f32..e6957b840 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -60,7 +60,7 @@ # 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install # (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) -- name: Unarchive Kiwix to permanent location (bin_only, i.e. NOT i686) +- name: Unarchive Kiwix binaries to permanent location (NOT i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: "{{ iiab_base }}/kiwix/bin" @@ -68,7 +68,7 @@ group: root when: kiwix_src_bin_only and kiwix_force_install -- name: Unarchive kiwix*i686.tar.bz2 to /tmp (NOT bin_only, i.e. i686) +- name: Unarchive kiwix*i686.tar.bz2 to /tmp (i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp @@ -77,7 +77,7 @@ group: root when: not kiwix_src_bin_only and kiwix_force_install -- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (NOT bin_only, i.e. i686) +- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (i686) shell: "mv /tmp/kiwix*i686/bin/* /opt/iiab/kiwix/bin/" when: not kiwix_src_bin_only and kiwix_force_install From fe30e1f461f240cb7c4a2c6d54cecda648fe9764 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:41:51 -0500 Subject: [PATCH 17/42] Reinforce multiarch & offline logic. Fail w/ explanation if kiwix-tools tarfile not in place. --- roles/kiwix/tasks/main.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index a12a82ece..3bf1b16f8 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -17,17 +17,27 @@ when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) +- debug: + msg: "WARNING: kiwix-tools SOFTWARE APPEARS UNAVAILABLE FOR YOUR OS/ARCHITECTURE." + when: not kiwix_src_file + - name: Download Kiwix software to /opt/iiab/downloads get_url: url: "{{ iiab_download_url }}/{{ kiwix_src_file }}" dest: "{{ downloads_dir }}/{{ kiwix_src_file }}" when: internet_available +- name: Check for /opt/iiab/downloads/{{ kiwix_src_file }} + stat: + path: "{{ downloads_dir }}/{{ kiwix_src_file }}" + register: kiwix_src + +- name: FAIL (force Ansible to exit) IF /opt/iiab/downloads/{{ kiwix_src_file }} doesn't exist + fail: + msg: "{ downloads_dir }}/{{ kiwix_src_file }} is REQUIRED in order to install Kiwix." + when: not kiwix_src.stat.exists + - include_tasks: kiwix_install.yml - when: kiwix_src_file is defined +# when: kiwix_src_file is defined tags: - kiwix - -- debug: - msg: "WARNING: kiwix-tools SOFTWARE NOT FOUND FOR YOUR OS/ARCHITECTURE." - when: not kiwix_src_file From aea4cf2332f42fc3ab3a5d4dbfaf27f0f3a3d5ab Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:49:27 -0500 Subject: [PATCH 18/42] Update main.yml --- roles/kiwix/tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index 3bf1b16f8..66fe18a57 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -17,8 +17,9 @@ when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) -- debug: - msg: "WARNING: kiwix-tools SOFTWARE APPEARS UNAVAILABLE FOR YOUR OS/ARCHITECTURE." +- name: Warn them if kiwix-tools appears unavailable for OS/architecture" + debug: + msg: "WARNING: kiwix-tools SOFTWARE APPEARS UNAVAILABLE FOR YOUR {{ ansible_machine }} OS/ARCHITECTURE." when: not kiwix_src_file - name: Download Kiwix software to /opt/iiab/downloads From 5d6ca0492806219247fe66f2ae4610956ddc0224 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 16:56:26 -0500 Subject: [PATCH 19/42] force fail in both situations (bad arch, tarfile missing) --- roles/kiwix/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/kiwix/tasks/main.yml b/roles/kiwix/tasks/main.yml index 66fe18a57..82926db84 100644 --- a/roles/kiwix/tasks/main.yml +++ b/roles/kiwix/tasks/main.yml @@ -17,8 +17,9 @@ when: ansible_machine == "i686" # COMMENT OUT LINE ABOVE TO TEST i686 CODE PATH ON X86_64 (WORKS NOV 2017) -- name: Warn them if kiwix-tools appears unavailable for OS/architecture" - debug: +- name: FAIL (force Ansible to exit) IF kiwix-tools appears unavailable for OS/architecture +# debug: + fail: msg: "WARNING: kiwix-tools SOFTWARE APPEARS UNAVAILABLE FOR YOUR {{ ansible_machine }} OS/ARCHITECTURE." when: not kiwix_src_file @@ -39,6 +40,5 @@ when: not kiwix_src.stat.exists - include_tasks: kiwix_install.yml -# when: kiwix_src_file is defined tags: - kiwix From cde91c388b04416d5b04ce4fb02fccc71c3c7965 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 19:54:35 -0500 Subject: [PATCH 20/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index e6957b840..17a92ffdc 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -37,7 +37,7 @@ - name: Set kiwix_force_install if kiwix-serve not found set_fact: kiwix_force_install: True - when: kiwix_bin.stat.exists is defined and not kiwix_bin.stat.exists + when: not kiwix_bin.stat.exists - name: Copy test.zim file if kiwix_force_install copy: @@ -110,13 +110,6 @@ - { src: 'iiab-make-kiwix-lib.py', dest: '/usr/bin/iiab-make-kiwix-lib.py', mode: '0755'} - { src: 'iiab-make-apache-config.py', dest: '/usr/bin/iiab-make-apache-config.py', mode: '0755'} -- name: Disable 'kiwix-serve' service - service: - name: kiwix-serve - enabled: no - state: stopped - when: not kiwix_enabled - - name: Enable 'kiwix-serve' service service: name: kiwix-serve @@ -124,6 +117,14 @@ state: restarted when: kiwix_enabled +- name: Disable 'kiwix-serve' service + service: + name: kiwix-serve + enabled: no + state: stopped + when: not kiwix_enabled +# IN THEORY: BOTH CRON ENTRIES BELOW *SHOULD* BE DELETED "when: not kiwix_enabled" + # In the past kiwix-serve did not stay running, so we'd been doing this hourly. # @mgautierfr & others suggest kiwix-serve might be auto-restarted w/o cron in # future, whenever service fails, if this really catches all cases?? From 03175b3a901aea5010615284beddbe02de35d83c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:27 -0500 Subject: [PATCH 21/42] Update main.yml --- roles/sugarizer/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 363f50e5d..72a4bf4a2 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -96,7 +96,7 @@ - { name: sugarizer } when: not sugarizer_enabled -- name: Add 'sugarizer' to service list at /etc/iiab/iiab.ini +- name: Add 'sugarizer' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: sugarizer From 11dec6ec323a05c2191ab6c2bed6cc15583e4698 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:33 -0500 Subject: [PATCH 22/42] Update main.yml --- roles/nextcloud/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 259182c8a..2899e1a0c 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -122,7 +122,7 @@ # following enables and disables - include_tasks: nextcloud_enabled.yml -- name: Add 'nextcloud' to service list +- name: Add 'nextcloud' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=nextcloud option='{{ item.option }}' From 99991a3bb444828f72e375516800b56e6b967392 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:37 -0500 Subject: [PATCH 23/42] Update main.yml --- roles/osm/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index de2ef415f..bcfd1b51c 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -137,7 +137,7 @@ service: name={{ apache_service }} state=restarted -- name: Add OSM to service list +- name: Add OSM to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=osm option='{{ item.option }}' From 4e70e8024797c37f099e1a5d6ce58f691afed073 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:40 -0500 Subject: [PATCH 24/42] Update main.yml --- roles/openvpn/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index ffee8caf5..c3f65802c 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -102,7 +102,7 @@ when: not openvpn_enabled and not installing -- name: Add OpenVPN to service list +- name: Add OpenVPN to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=openvpn option='{{ item.option }}' From db6c3f349ce11d1ba926d0bb7a7b017cfa2bb93c Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:43 -0500 Subject: [PATCH 25/42] Update main.yml --- roles/kalite/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index ed69c882d..aa43b5f22 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -34,7 +34,7 @@ - include_tasks: enable.yml -- name: Add 'kalite-serve' to service list +- name: Add 'kalite-serve' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=kalite option='{{ item.option }}' From 141b1af133ffd3735e8d1e4b52e1937ab2d9b80b Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:49 -0500 Subject: [PATCH 26/42] Update main.yml --- roles/calibre/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 5b999d9f1..950ca795a 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -77,7 +77,7 @@ #async: 900 #poll: 5 -- name: Add 'calibre-serve' to service list at /etc/iiab/iiab.ini +- name: Add 'calibre-serve' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: calibre From 3b51300cde1326c22d2d89df33dc5793bde1051d Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:53 -0500 Subject: [PATCH 27/42] Update main.yml --- roles/phpmyadmin/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index a2ffd40ff..80ab5cb54 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -64,7 +64,7 @@ state: absent when: not phpmyadmin_enabled and is_debuntu -- name: Add phpmyadmin to service list +- name: Add phpmyadmin to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: phpmyadmin From 1732d3d229f522c6c26cde12d9036eccbc68ee85 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:05:57 -0500 Subject: [PATCH 28/42] Update install.yml --- roles/wordpress/tasks/install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 564c429a7..7ffb1cfa7 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -123,7 +123,7 @@ - name: Restart Apache, so it picks up the new aliases service: name={{ apache_service }} state=restarted -- name: Add 'wordpress' to service list +- name: Add 'wordpress' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=wordpress option='{{ item.option }}' From 97cc140ac7c935ad8ef2c71019af9a7dbb8abd81 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:08:19 -0500 Subject: [PATCH 29/42] Update main.yml --- roles/osm/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index bcfd1b51c..5fb5d28d3 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -137,7 +137,7 @@ service: name={{ apache_service }} state=restarted -- name: Add OSM to list of services at /etc/iiab/iiab.ini +- name: Add 'osm' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=osm option='{{ item.option }}' From 8a7a86bce809eed260a763858554531ab47bef71 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:08:50 -0500 Subject: [PATCH 30/42] Update main.yml --- roles/openvpn/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index c3f65802c..da58b8b15 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -102,7 +102,7 @@ when: not openvpn_enabled and not installing -- name: Add OpenVPN to list of services at /etc/iiab/iiab.ini +- name: Add 'openvpn' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=openvpn option='{{ item.option }}' From 4d0ab1e324954968202dc67661d41f5c64ed9103 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:09:09 -0500 Subject: [PATCH 31/42] Update main.yml --- roles/kalite/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index aa43b5f22..2359660ad 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -34,7 +34,7 @@ - include_tasks: enable.yml -- name: Add 'kalite-serve' to list of services at /etc/iiab/iiab.ini +- name: Add 'kalite' to list of services at /etc/iiab/iiab.ini ini_file: dest='{{ service_filelist }}' section=kalite option='{{ item.option }}' From c155ccd2f6d43c204ec75fce7679405e36b59b78 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:10:42 -0500 Subject: [PATCH 32/42] Update main.yml --- roles/sugarizer/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/sugarizer/tasks/main.yml b/roles/sugarizer/tasks/main.yml index 72a4bf4a2..f81005737 100644 --- a/roles/sugarizer/tasks/main.yml +++ b/roles/sugarizer/tasks/main.yml @@ -103,9 +103,9 @@ option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - option: name - value: Sugarizer - - option: description - value: '"The Sugar Learning Platform began with the famous One Laptop Per Child project, written in Python. Sugarizer is the new HTML/JavaScript implementation of Sugar, usable in most all browsers."' - - option: enabled - value: "{{ sugarizer_enabled }}" + - option: name + value: Sugarizer + - option: description + value: '"The Sugar Learning Platform began with the famous One Laptop Per Child project, written in Python. Sugarizer is the new HTML/JavaScript implementation of Sugar, usable in most all browsers."' + - option: enabled + value: "{{ sugarizer_enabled }}" From cbb62236c8d71f906cb1bbaa46cda24e84b2e28f Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:12:09 -0500 Subject: [PATCH 33/42] Update main.yml --- roles/nextcloud/tasks/main.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/roles/nextcloud/tasks/main.yml b/roles/nextcloud/tasks/main.yml index 2899e1a0c..24dc3c05a 100644 --- a/roles/nextcloud/tasks/main.yml +++ b/roles/nextcloud/tasks/main.yml @@ -123,18 +123,19 @@ - include_tasks: nextcloud_enabled.yml - name: Add 'nextcloud' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=nextcloud - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: Nextcloud + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: nextcloud - - option: description - value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."' - - option: path - value: "{{ nextcloud_prefix }}/nextcloud" - - option: source - value: "{{ nextcloud_src_file }}" - - option: enabled - value: "{{ nextcloud_enabled }}" + - option: name + value: Nextcloud + - option: description + value: '"NextCloud is a local server-based facility for sharing files, photos, contacts, calendars, etc."' + - option: path + value: "{{ nextcloud_prefix }}/nextcloud" + - option: source + value: "{{ nextcloud_src_file }}" + - option: enabled + value: "{{ nextcloud_enabled }}" From a4290997ee93adca52ba335194a05ab8a5bc21c0 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:18:06 -0500 Subject: [PATCH 34/42] Update main.yml --- roles/osm/tasks/main.yml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/roles/osm/tasks/main.yml b/roles/osm/tasks/main.yml index 5fb5d28d3..bfff07863 100644 --- a/roles/osm/tasks/main.yml +++ b/roles/osm/tasks/main.yml @@ -138,16 +138,18 @@ state=restarted - name: Add 'osm' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=osm - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: osm + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: Internet-in-a-Box - - option: description - value: '"The Internet-in-a-Box is a small, inexpensive device which provides essential Internet resources without any Internet connection. It provides a local copy of half a terabyte of the world’s Free information."' - - option: path - value: /osm - - option: enabled - value: "{{ osm_enabled }}" + - option: name + value: OpenStreetMap + - option: description + value: '"OpenStreetMap offers beautiful maps of the entire planet, continually created & updated by volunteers (much in the same way as Wikipedia) but for maps."' + # value: '"The Internet-in-a-Box is a small, inexpensive device which provides essential Internet resources without any Internet connection. It provides a local copy of half a terabyte of the world’s Free information."' + - option: path + value: /osm + - option: enabled + value: "{{ osm_enabled }}" From 0ee888c7172588ba64858bb5caa2de0c38f32807 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:19:45 -0500 Subject: [PATCH 35/42] Update main.yml --- roles/openvpn/tasks/main.yml | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/roles/openvpn/tasks/main.yml b/roles/openvpn/tasks/main.yml index da58b8b15..e195389a6 100644 --- a/roles/openvpn/tasks/main.yml +++ b/roles/openvpn/tasks/main.yml @@ -103,20 +103,21 @@ - name: Add 'openvpn' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=openvpn - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: openvpn + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: "openvpn" - - option: description - value: '"OpenVPN is a means of connecting to a server anywhere on the internet, via a middleman server."' - - option: middleman_url - value: "{{ vpn_presence }}" - - option: port - value: "{{ openvpn_server_port }}" - - option: enabled - value: "{{ openvpn_enabled }}" - - option: cron_enabled - value: "{{ openvpn_cron_enabled }}" + - option: name + value: OpenVPN + - option: description + value: '"OpenVPN is a means of connecting to a server anywhere on the internet, via a middleman server."' + - option: middleman_url + value: "{{ vpn_presence }}" + - option: port + value: "{{ openvpn_server_port }}" + - option: enabled + value: "{{ openvpn_enabled }}" + - option: cron_enabled + value: "{{ openvpn_cron_enabled }}" From 64e8bb15ef1b6a1018bc6e8204db8ee9db38e3ea Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:21:04 -0500 Subject: [PATCH 36/42] Update main.yml --- roles/kalite/tasks/main.yml | 41 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/roles/kalite/tasks/main.yml b/roles/kalite/tasks/main.yml index 2359660ad..f68fd7d92 100644 --- a/roles/kalite/tasks/main.yml +++ b/roles/kalite/tasks/main.yml @@ -35,24 +35,25 @@ - include_tasks: enable.yml - name: Add 'kalite' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=kalite - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: kalite + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: kalite - - option: description - value: '"KA Lite is a server to present Khan Academy videos offline and to download them."' - - option: path - value: "{{ kalite_root }}" - - option: server_name - value: "{{ kalite_server_name }}" - - option: port - value: "{{ kalite_server_port }}" - - option: enabled - value: "{{ kalite_enabled }}" - - option: cron_enabled - value: "{{ kalite_cron_enabled }}" - - option: khan_assessment_install - value: "{{ khan_assessment_install }}" + - option: name + value: "KA Lite" + - option: description + value: '"KA Lite is a server to present Khan Academy videos offline and to download them."' + - option: path + value: "{{ kalite_root }}" + - option: server_name + value: "{{ kalite_server_name }}" + - option: port + value: "{{ kalite_server_port }}" + - option: enabled + value: "{{ kalite_enabled }}" + - option: cron_enabled + value: "{{ kalite_cron_enabled }}" + - option: khan_assessment_install + value: "{{ khan_assessment_install }}" From ec877e9c5c0192bdb3d070da5c21fdfc79b9ab1a Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:22:16 -0500 Subject: [PATCH 37/42] Update main.yml --- roles/calibre/tasks/main.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 950ca795a..c856328dd 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -77,20 +77,22 @@ #async: 900 #poll: 5 -- name: Add 'calibre-serve' to list of services at /etc/iiab/iiab.ini +- name: Add 'calibre' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: calibre option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - option: description - value: '"Calibre is an extremely popular personal library system for e-books."' - - option: url - value: "{{ calibre_src_url }}" - - option: database - value: "{{ calibre_dbpath }}" - - option: port - value: "{{ calibre_port }}" - - option: enabled - value: "{{ calibre_enabled }}" + - option: name + value: Calibre + - option: description + value: '"Calibre is an extremely popular personal library system for e-books."' + - option: url + value: "{{ calibre_src_url }}" + - option: database + value: "{{ calibre_dbpath }}" + - option: port + value: "{{ calibre_port }}" + - option: enabled + value: "{{ calibre_enabled }}" From 0eb899754842b1d02556d1959712a3fb4e76f482 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:23:07 -0500 Subject: [PATCH 38/42] Update main.yml --- roles/phpmyadmin/tasks/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/roles/phpmyadmin/tasks/main.yml b/roles/phpmyadmin/tasks/main.yml index 80ab5cb54..ebc15a756 100644 --- a/roles/phpmyadmin/tasks/main.yml +++ b/roles/phpmyadmin/tasks/main.yml @@ -64,18 +64,18 @@ state: absent when: not phpmyadmin_enabled and is_debuntu -- name: Add phpmyadmin to list of services at /etc/iiab/iiab.ini +- name: Add 'phpmyadmin' to list of services at /etc/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: phpmyadmin option: "{{ item.option }}" value: "{{ item.value }}" with_items: - - option: name - value: phpMyAdmin - - option: description - value: '"phpMyAdmin is an interface with a MySQL database written in PHP, and available to administer the database engine locally or across the network."' - - option: path - value: /opt/phpmyadmin - - option: enabled - value: "{{ phpmyadmin_enabled }}" + - option: name + value: phpMyAdmin + - option: description + value: '"phpMyAdmin is an interface with a MySQL database written in PHP, and available to administer the database engine locally or across the network."' + - option: path + value: /opt/phpmyadmin + - option: enabled + value: "{{ phpmyadmin_enabled }}" From 7c18431339ba714c31350391cf4440565fb7a292 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 20:24:49 -0500 Subject: [PATCH 39/42] Update install.yml --- roles/wordpress/tasks/install.yml | 45 ++++++++++++++++--------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/roles/wordpress/tasks/install.yml b/roles/wordpress/tasks/install.yml index 7ffb1cfa7..8dd31f132 100644 --- a/roles/wordpress/tasks/install.yml +++ b/roles/wordpress/tasks/install.yml @@ -124,26 +124,27 @@ service: name={{ apache_service }} state=restarted - name: Add 'wordpress' to list of services at /etc/iiab/iiab.ini - ini_file: dest='{{ service_filelist }}' - section=wordpress - option='{{ item.option }}' - value='{{ item.value }}' + ini_file: + dest: "{{ service_filelist }}" + section: wordpress + option: "{{ item.option }}" + value: "{{ item.value }}" with_items: - - option: name - value: wordpress - - option: description - value: '"WordPress is a blog and web site management application."' - - option: wordpress_src - value: "{{ wordpress_src }}" - - option: wp_abs_path - value: "{{ wp_abs_path }}" - - option: wp_db_name - value: "{{ wp_db_name }}" - - option: wp_db_user - value: "{{ wp_db_user }}" - - option: wp_url - value: "{{ wp_url }}" - - option: wp_full_url - value: "{{ wp_full_url }}" - - option: wordpress_enabled - value: "{{ wordpress_enabled }}" + - option: name + value: WordPress + - option: description + value: '"WordPress is a blog and web site management application."' + - option: wordpress_src + value: "{{ wordpress_src }}" + - option: wp_abs_path + value: "{{ wp_abs_path }}" + - option: wp_db_name + value: "{{ wp_db_name }}" + - option: wp_db_user + value: "{{ wp_db_user }}" + - option: wp_url + value: "{{ wp_url }}" + - option: wp_full_url + value: "{{ wp_full_url }}" + - option: wordpress_enabled + value: "{{ wordpress_enabled }}" From d2d10d07b0b7d45798d9a86b9b806ec5a17688de Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 21:34:37 -0500 Subject: [PATCH 40/42] fix calibre_debs_on_debian conditionals --- roles/calibre/tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/calibre/tasks/main.yml b/roles/calibre/tasks/main.yml index 5b999d9f1..25d91934d 100644 --- a/roles/calibre/tasks/main.yml +++ b/roles/calibre/tasks/main.yml @@ -3,12 +3,12 @@ # RUNS IF /usr/bin/calibre-uninstall DOES NOT ALEADY EXIST - name: Install Calibre via calibre-installer.py (OS's other than Raspbian) include_tasks: py-installer.yml - when: (not is_rpi) and (not calibre_debs_on_debian) - #when: is_redhat or is_ubuntu + when: is_redhat or is_ubuntu or (is_debian and not calibre_debs_on_debian) + #when: not is_rpi - name: Install Calibre via .debs (Raspbian) include_tasks: debs.yml - when: is_rpi or calibre_debs_on_debian + when: is_rpi or (is_debian and calibre_debs_on_debian) #when: is_rpi or is_debian # (is_debian also covers & includes is_rpi) # 2. STOP CALIBRE SERVICE IF IT EXISTS (REQUIRED FOR DB ACTIVITY...AND IF not calibre_enabled) From cffabedaad663d6949fdc40003c8ebdfc4248f10 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 21:58:56 -0500 Subject: [PATCH 41/42] Update main.yml --- roles/kiwix/defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/kiwix/defaults/main.yml b/roles/kiwix/defaults/main.yml index 556431ceb..4ddfda023 100644 --- a/roles/kiwix/defaults/main.yml +++ b/roles/kiwix/defaults/main.yml @@ -17,7 +17,7 @@ kiwix_port: 3000 iiab_zim_path: "{{ content_base }}/zims" kiwix_library_xml: "{{ iiab_zim_path }}/library.xml" # Unused: (Nov 2017) -# kiwix_content_path: "{{ iiab_zim_path }}/content" +kiwix_content_path: "{{ iiab_zim_path }}/content" # Installation Variables kiwix_install: True From 254fb22305ca0b1871ca93b4dea54f00131a1579 Mon Sep 17 00:00:00 2001 From: A Holt Date: Sun, 26 Nov 2017 22:10:30 -0500 Subject: [PATCH 42/42] Update kiwix_install.yml --- roles/kiwix/tasks/kiwix_install.yml | 114 ++++++++++++++-------------- 1 file changed, 58 insertions(+), 56 deletions(-) diff --git a/roles/kiwix/tasks/kiwix_install.yml b/roles/kiwix/tasks/kiwix_install.yml index 17a92ffdc..f199f5f57 100644 --- a/roles/kiwix/tasks/kiwix_install.yml +++ b/roles/kiwix/tasks/kiwix_install.yml @@ -1,6 +1,4 @@ -# 1. CREATE/VERIFY CRITICAL DIRECTORIES & FILES ARE IN PLACE - -- name: Create various directories for Kiwix ZIM files +- name: Create various directories for Kiwix's ZIM files file: path: "{{ item }}" owner: root @@ -9,7 +7,7 @@ state: directory with_items: - "{{ iiab_zim_path }}" - - "{{ iiab_zim_path }}/content" + - "{{ kiwix_content_path }}" - "{{ iiab_zim_path }}/index" - name: Check for /library/zims/library.xml @@ -37,38 +35,25 @@ - name: Set kiwix_force_install if kiwix-serve not found set_fact: kiwix_force_install: True - when: not kiwix_bin.stat.exists + when: kiwix_bin.stat.exists is defined and not kiwix_bin.stat.exists -- name: Copy test.zim file if kiwix_force_install +- name: Copy test.zim file copy: src: test.zim - dest: "{{ iiab_zim_path }}/content/test.zim" + dest: "{{ kiwix_content_path }}/test.zim" mode: 0644 owner: root group: root force: no when: kiwix_force_install -- name: Create /opt/iiab/kiwix/bin directory - file: - path: "{{ iiab_base }}/kiwix/bin" - owner: root - group: root - mode: 0755 - state: directory +# We get a whole web server for i686 but only the kiwix execs for linux64 & armhf -# 2. INSTALL KIWIX-TOOLS EXECUTABLES IF kiwix_force_install -# (We get a whole web server for i686 but only kiwix execs for linux64 & armhf) - -- name: Unarchive Kiwix binaries to permanent location (NOT i686) - unarchive: - src: "{{ downloads_dir }}/{{ kiwix_src_file }}" - dest: "{{ iiab_base }}/kiwix/bin" - owner: root - group: root - when: kiwix_src_bin_only and kiwix_force_install - -- name: Unarchive kiwix*i686.tar.bz2 to /tmp (i686) +# EXPERIMENTAL i686 CODE PATH: as of Nov 2017 bunzip2 then untar unpacks +# to /tmp/kiwix-0.10-i686/bin WHOSE CONTENTS NEEDS TO BE MOVED TO +# /opt/iiab/kiwix/bin (STANZA FURTHER BELOW). All i686 code needs testing. +# ALSO: code below may need to be revived to chown -R root:root & chmod +- name: Unarchive kiwix-*-linux-i686.tar.bz2 to /tmp (not bin_only, i.e. i686) unarchive: src: "{{ downloads_dir }}/{{ kiwix_src_file }}" dest: /tmp @@ -77,11 +62,36 @@ group: root when: not kiwix_src_bin_only and kiwix_force_install -- name: Move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (i686) +- name: Create kiwix/bin directory + file: + path: "{{ iiab_base }}/kiwix/bin" + owner: root + group: root + mode: 0755 + state: directory + +# EXPERIMENTAL i686 CODE PATH +- name: move /tmp/kiwix*i686/bin/* to permanent location /opt/iiab/kiwix/bin (not bin_only, i.e. i686) shell: "mv /tmp/kiwix*i686/bin/* /opt/iiab/kiwix/bin/" when: not kiwix_src_bin_only and kiwix_force_install -# 3. ENABLE MODS FOR APACHE PROXY IF DEBUNTU +- name: Unarchive Kiwix to permanent location (bin_only, i.e. not i686) + unarchive: + src: "{{ downloads_dir }}/{{ kiwix_src_file }}" + dest: "{{ iiab_base }}/kiwix/bin" + owner: root + group: root + when: kiwix_src_bin_only and kiwix_force_install + +# MIGHT BE RESTORED LATER FOR i686? Unused as of Nov 2017: +# # workaround because unarchive does not set ownership properly +# - name: "Set ownership as if: 'chown -R root:root /opt/iiab/kiwix'" +# file: +# path: "{{ iiab_base }}/kiwix" +# owner: root +# group: root +# recurse: yes +# mode: ???? - name: Enable the mods which permit Apache to proxy (debuntu) apache2_module: @@ -93,7 +103,22 @@ - rewrite when: is_debuntu -# 4. CREATE/ENABLE/DISABLE KIWIX SERVICE & ITS CRON JOB +# workaround because kiwix-serve does not stay running +- name: Make a crontab entry to restart kiwix-serve at 4AM (debuntu) +# * * * * * user-name command to be executed + lineinfile: + line: "0 4 * * * root /bin/systemctl restart kiwix-serve.service" + dest: /etc/crontab + when: is_debuntu + +- name: Make a crontab entry to restart kiwix-serve at 4AM (redhat) +# * * * * * user-name command to be executed + lineinfile: + line: "0 4 * * * root /usr/bin/systemctl restart kiwix-serve.service" + dest: /etc/crontab + when: is_redhat + +# Create Kiwix service - name: Create 'kiwix-serve' service template: @@ -123,30 +148,8 @@ enabled: no state: stopped when: not kiwix_enabled -# IN THEORY: BOTH CRON ENTRIES BELOW *SHOULD* BE DELETED "when: not kiwix_enabled" -# In the past kiwix-serve did not stay running, so we'd been doing this hourly. -# @mgautierfr & others suggest kiwix-serve might be auto-restarted w/o cron in -# future, whenever service fails, if this really catches all cases?? -# https://github.com/iiab/iiab/issues/484#issuecomment-342151726 -- name: Make a crontab entry to restart kiwix-serve at 4AM (debuntu) - lineinfile: - # mn hr dy mo day-of-week[Sunday=0] username command-to-be-executed - line: "0 4 * * * root /bin/systemctl restart kiwix-serve.service" - dest: /etc/crontab - when: kiwix_enabled and is_debuntu - -- name: Make a crontab entry to restart kiwix-serve at 4AM (redhat) -# * * * * * user-name command to be executed - lineinfile: - # mn hr dy mo day-of-week[Sunday=0] username command-to-be-executed - line: "0 4 * * * root /usr/bin/systemctl restart kiwix-serve.service" - dest: /etc/crontab - when: kiwix_enabled and is_redhat - -# 5. FINALIZE - -- name: Add 'kiwix-serve' to list of services at /etc/iiab/iiab.ini +- name: Add 'kiwix-serve' to list of services at /opt/iiab/iiab.ini ini_file: dest: "{{ service_filelist }}" section: kiwix-serve @@ -157,7 +160,7 @@ value: kiwix-serve - option: description value: '"Part of https://github.com/kiwix/kiwix-tools/ - kiwix-serve is the most used web server for ZIM files."' -# The following 4 lines are unused: (Nov 2017) +# The following 4 lines are unused as of Nov 2017: # - option: kiwix_url # value: "{{ kiwix_url }}" # - option: kiwix_path @@ -168,8 +171,7 @@ value: "{{ iiab_zim_path }}" - option: kiwix_library_xml value: "{{ kiwix_library_xml }}" -# The following 2 lines are unused: (Nov 2017) -# - option: kiwix_content_path -# value: "{{ kiwix_content_path }}" + - option: kiwix_content_path + value: "{{ kiwix_content_path }}" - option: enabled value: "{{ kiwix_enabled }}"