1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-12 19:22:24 +00:00

Merge pull request #110 from iiab/master

sync from iiab/iiab
This commit is contained in:
A Holt 2018-07-18 23:27:19 -04:00 committed by GitHub
commit d28883dab8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 161 additions and 96 deletions

View file

@ -85,7 +85,7 @@
src: roles/1-prep/templates/iiab_env.py.j2
dest: /etc/iiab/iiab_env.py
- name: Generate the offline documents
- name: Run /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (script was installed at the beginning of Stage 3 = roles/3-base-server/tasks/main.yml, which runs the HTTPD playbook = roles/httpd/tasks/main.yml)
command: /usr/bin/iiab-refresh-wiki-docs
when: not nodocs

View file

@ -1,16 +1,19 @@
- name: Create home directory
file: path={{ doc_root }}/home
mode=0755
owner={{ apache_user }}
group={{ apache_user }}
state=directory
file:
path: "{{ doc_root }}/home"
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
mode: 0755
state: directory
- name: Install admin homepage into apache2
template: src=iiab-homepage.conf
dest=/etc/{{ apache_config_dir }}/iiab-homepage.conf
template:
src: iiab-homepage.conf
dest: "/etc/{{ apache_config_dir }}/iiab-homepage.conf"
- name: Enable the home page
file: src=/etc/{{ apache_config_dir }}/iiab-homepage.conf
dest=/etc/apache2/sites-enabled/iiab-homepage.conf
state=link
file:
src: "/etc/{{ apache_config_dir }}/iiab-homepage.conf"
dest: /etc/apache2/sites-enabled/iiab-homepage.conf
state: link
when: is_debuntu

View file

@ -169,7 +169,12 @@
tags:
- base
- name: Place the script to generate homepages
# Fixes search @ http://box/modules/es-wikihow - see https://github.com/iiab/iiab/issues/829
- include_tasks: php-stem.yml
tags:
- base
- name: Install /usr/bin/iiab-refresh-wiki-docs (scraper script) to create http://box/info offline documentation (will be run at the end of Stage 4 = roles/4-server-options/tasks/main.yml)
template:
src: refresh-wiki-docs.sh
dest: /usr/bin/iiab-refresh-wiki-docs

View file

@ -0,0 +1,38 @@
# Fixes search @ http://box/modules/es-wikihow (popular with Spanish youth)
# Source code: http://download.iiab.io/packages/php-stem.src.tar
# June 2018 debugging & compilation thanks to Tim Moody & George Hunt
# Original bug: https://github.com/iiab/iiab/issues/829
#- name: Download php-stem.rpi.tar
# command: cd /; wget http://download.iiab.io/packages/php-stem.rpi.tar
# when: is_rpi
#- name: Download php-stem.x86.tar
# command: cd /; wget http://download.iiab.io/packages/php-stem.x64.tar
# when: not is_rpi
- name: Download & unpack php-stem.rpi.tar to / (rpi)
unarchive:
src: http://download.iiab.io/packages/php-stem.rpi.tar
dest: /
owner: root
group: root
#mode: ????
remote_src: yes
when: is_rpi
- name: Download & unpack php-stem.x86.tar to / (not rpi)
unarchive:
src: http://download.iiab.io/packages/php-stem.x64.tar
dest: /
owner: root
group: root
#mode: ????
remote_src: yes
when: not is_rpi
# No need to do this twice? Happens later @ https://github.com/iiab/iiab/blob/master/roles/3-base-server/tasks/main.yml#L24-L28
#- name: Restart apache2 / httpd
# service:
# name: "{{ apache_service }}"
# state: restarted

View file

@ -1,6 +1,7 @@
- name: Install OSM required packages
package: name={{ item }}
state=present
- name: Install OSM required packages (debuntu)
package:
name: "{{ item }}"
state: present
with_items:
- gcc
- python-dev
@ -9,9 +10,10 @@
- libapache2-mod-xsendfile
when: is_debuntu
- name: Install OSM required packages
package: name={{ item }}
state=present
- name: Install OSM required packages (not debuntu)
package:
name: "{{ item }}"
state: present
with_items:
- python-pip
- gcc
@ -22,27 +24,30 @@
when: not is_debuntu
# OSM wants a specific version do that first
- name: Install Whoosh 2.6
pip: name=whoosh
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
version=2.6
extra_args="--no-cache-dir"
- name: Install Whoosh 2.6 (debuntu)
pip:
name: whoosh
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
version: 2.6
extra_args: "--no-cache-dir"
when: internet_available and is_debuntu
- name: Install Flask 0.12X
pip: name=Flask
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
version=0.12.4
extra_args="--no-cache-dir"
- name: Install Flask 0.12X (debuntu)
pip:
name: Flask
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
version: 0.12.4
extra_args: "--no-cache-dir"
when: internet_available and is_debuntu
- name: Install OSM with dependencies
pip: name={{ item }}
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
extra_args="--no-cache-dir"
- name: Install OSM with dependencies (debuntu)
pip:
name: "{{ item }}"
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
extra_args: "--no-cache-dir"
with_items:
- MarkupSafe
- pytz
@ -50,26 +55,29 @@
when: internet_available and is_debuntu
# OSM wants a specific version do that first
- name: Install Whoosh 2.6
pip: name=whoosh
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
version=2.6
- name: Install Whoosh 2.6 (not debuntu)
pip:
name: whoosh
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
version: 2.6
# extra_args="--no-cache-dir"
when: internet_available and not is_debuntu
- name: Install Flask 0.12X
pip: name=Flask
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
version=0.12.4
- name: Install Flask 0.12X (not debuntu)
pip:
name: Flask
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
version: 0.12.4
# extra_args="--no-cache-dir"
when: internet_available and not is_debuntu
- name: Install OSM with dependencies
pip: name={{ item }}
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
- name: Install OSM with dependencies (not debuntu)
pip:
name: "{{ item }}"
virtualenv: "{{ osm_venv }}"
virtualenv_site_packages: no
# extra_args="--no-cache-dir"
with_items:
- MarkupSafe
@ -77,81 +85,92 @@
- Internet-in-a-Box
when: internet_available and not is_debuntu
- name: Set osm_path
- name: Set osm_path (redhat)
set_fact:
osm_path: "{{ osm_venv }}/{{ python_path }}/iiab"
osm_path: "{{ osm_venv }}/{{ python_path }}/iiab"
when: osm_enabled and is_redhat
- name: Set osm_path
- name: Set osm_path (debuntu)
set_fact:
osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab"
osm_path: "{{ osm_venv }}/lib/python2.7/site-packages/iiab"
when: osm_enabled and is_debuntu
- name: Point wsgi to virtual environment (all OS's)
lineinfile: dest={{ osm_venv }}/bin/iiab.wsgi
regexp="path_to_virtualenv = None"
line="path_to_virtualenv = '/usr/local/osm'"
state=present
lineinfile:
dest: "{{ osm_venv }}/bin/iiab.wsgi"
regexp: "path_to_virtualenv = None"
line: "path_to_virtualenv = '/usr/local/osm'"
state: present
- name: Copy OSM config file (all OS's)
template: backup=no
src=osm.conf.j2
dest=/etc/{{ apache_config_dir }}/osm.conf
owner=root
group=root
mode=0644
template:
src: osm.conf.j2
dest: "/etc/{{ apache_config_dir }}/osm.conf"
owner: root
group: root
mode: 0644
backup: no
when: osm_enabled
- name: Create a link from sites-enabled to sites-available (debuntu)
file: src=/etc/{{ apache_config_dir }}/osm.conf
dest=/etc/apache2/sites-enabled/osm.conf
state=link
file:
src: "/etc/{{ apache_config_dir }}/osm.conf"
dest: /etc/apache2/sites-enabled/osm.conf
state: link
when: osm_enabled and is_debuntu
- name: Remove the link from sites-enabled to sites-available (debuntu)
file: dest=/etc/apache2/sites-enabled/osm.conf
state=absent
file:
dest: /etc/apache2/sites-enabled/osm.conf
state: absent
when: not osm_enabled and is_debuntu
- name: Remove the osm.conf (redhat)
file: dest=/{{ apache_config_dir }}/osm.conf
state=absent
file:
dest: "/{{ apache_config_dir }}/osm.conf"
state: absent
when: not osm_enabled and is_redhat
- name: Remove link to cgi (all OS's)
file: dest={{ doc_root }}/osm.wsgi
state=absent
file:
dest: "{{ doc_root }}/osm.wsgi"
state: absent
when: not osm_enabled
- name: Create link to cgi (all OS's)
file: src={{ osm_venv }}/bin/iiab.wsgi
dest={{ doc_root }}/osm.wsgi
owner=root
group=root
state=link
file:
src: "{{ osm_venv }}/bin/iiab.wsgi"
dest: "{{ doc_root }}/osm.wsgi"
owner: root
group: root
state: link
when: osm_enabled
- name: Create the knowledge data set folders
file: path=/library/knowledge/modules
state=directory
owner={{ apache_user }}
group={{ apache_user }}
file:
path: /library/knowledge/modules
state: directory
owner: "{{ apache_user }}"
group: "{{ apache_user }}"
# the following was brought into OSM playbook from iiab-factory osm-fix script
- name: Copy the files
template: src={{ item.src }} dest={{ item.dest }}
template:
src: "{{ item.src }}"
dest: "{{ item.dest }}"
with_items:
- { src: 'defaults.ini', dest: "{{ osm_path }}/" }
- { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' }
- { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" }
- { src: 'map.html', dest: "{{ osm_path }}/static/map.html" }
- { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" }
- { src: '{{ osm_path }}/static/map.html', dest: "{{ osm_path }}/static/index.html" }
- { src: 'defaults.ini', dest: "{{ osm_path }}/" }
- { src: 'etc.iiab.conf', dest: '/etc/iiab.conf' }
- { src: 'map_search.py', dest: "{{ osm_path }}/map_search.py" }
- { src: 'map.html', dest: "{{ osm_path }}/static/map.html" }
- { src: 'l.control.geosearch.js', dest: "{{ osm_path }}/static/lib/leaflet/geosearch/l.control.geosearch.js" }
- { src: "{{ osm_path }}/static/map.html", dest: "{{ osm_path }}/static/index.html" }
when: osm_enabled
- name: Restart httpd service
service: name={{ apache_service }}
state=restarted
service:
name: "{{ apache_service }}"
state: restarted
- name: Add 'osm' to list of services at /etc/iiab/iiab.ini
ini_file:

View file

@ -26,7 +26,7 @@
- { src: 'iiab-usb-lib-show-all-on' , dest: '/usr/bin/', mode: '0755' }
- { src: 'iiab-usb-lib-show-all-off' , dest: '/usr/bin/', mode: '0755' }
- name: Enable exfat and ntfs
- name: Enable exFAT and NTFS
lineinfile:
regexp: '^FILESYSTEMS.*'
line: 'FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus exfat fuseblk ntfs"'
@ -53,7 +53,7 @@
state: absent
when: not usb_lib_enabled
- name: Put a variable in iiab.env for display of content at root of USB
- name: Put variable in iiab.env that enables display of content at root of USB
lineinfile:
dest: /etc/iiab/iiab.env
regexp: "^IIAB_USB_LIB_SHOW_ALL.*"
@ -65,14 +65,14 @@
dest: "/etc/{{ apache_config_dir }}"
when: usb_lib_enabled
- name: Create the link to enable (debian)
- name: Create the link to enable (debuntu)
file:
src: "/etc/{{ apache_config_dir }}/content_dir.conf"
dest: /etc/apache2/sites-enabled/content_dir.conf
state: link
when: is_debuntu
- name: Remove the link that enables (debian)
- name: Remove the link that enables (debuntu)
file:
src: "/etc/{{ apache_config_dir }}/content_dir.conf"
dest: /etc/apache2/sites-enabled/content_dir.conf

View file

@ -2,7 +2,7 @@
echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n'
echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n'
echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirrors.\n'
echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n'

View file

@ -2,7 +2,7 @@
echo -e '\n\nSTRONGLY RECOMMENDED PREREQUISITE: (1) remove all prior versions of Ansible using "apt purge ansible" and/or "pip uninstall ansible" and (2) clear out all lines containing ansible from /etc/apt/sources.list and /etc/apt/sources.list.d/*\n'
echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirror.\n'
echo -e 'WARNING: repeatedly re-run "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 93C4A3FD7BB9C367" if this part of the script fails due to network/mirrors.\n'
echo -e 'COMPLETE INSTALL INSTRUCTIONS:\nhttps://github.com/iiab/iiab/wiki/IIAB-Installation#do-everything-from-scratch\n'