1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 11:42:08 +00:00
iiab/roles/osm/tasks/main.yml
2017-09-18 13:38:53 -07:00

122 lines
3.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

- name: Install IIAB required packages
package: name={{ item }}
state=present
with_items:
- gcc
- python-dev
- liblzma-dev
- libapache2-mod-wsgi
- libapache2-mod-xsendfile
when: is_debuntu
- name: Install IIAB required packages
package: name={{ item }}
state=present
with_items:
- python-pip
- gcc
- python-devel
- xz-devel
- mod_wsgi
- mod_xsendfile
when: not is_debuntu
# IIAB 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="--disable-pip-version-check"
when: internet_available
- name: Install IIAB with dependencies
pip: name={{ item }}
virtualenv={{ osm_venv }}
virtualenv_site_packages=no
extra_args="--disable-pip-version-check"
with_items:
- MarkupSafe
- pytz
- Internet-in-a-Box
when: internet_available
- name: Set osm_path
set_fact:
osm_path: "{{ osm_venv }}iiab"
when: osm_enabled
- name: All - Copy IIAB config file
template: backup=no
src=osm.conf.j2
dest=/etc/{{ apache_config_dir }}/osm.conf
owner=root
group=root
mode=0644
when: osm_enabled
- name: Debuntu - Create a link from sites-enabled to sites-available
file: src=/etc/{{ apache_config_dir }}/osm.conf
dest=/etc/apache2/sites-enabled/osm.conf
state=link
when: osm_enabled and is_debuntu
- name: Debuntu - Remove the link from sites-enabled to sites-available
file: dest=/etc/apache2/sites-enabled/osm.conf
state=absent
when: not osm_enabled and is_debuntu
- name: Redhat - Remove the osm.conf
file: dest=/{{ apache_config_dir }}/osm.conf
state=absent
when: not osm_enabled and is_redhat
- name: All - Remove link to cgi
file: dest={{ doc_root }}/osm.wsgi
state=absent
when: not osm_enabled
- name: All - Create link to cgi
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 }}
# the following was brought into OSM playbook from iiab-factory osm-fix script
- name: Copy the files
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" }
when: osm_enabled
- name: Restart httpd service
service: name={{ apache_service }}
state=restarted
- name: add osm to service list
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 worlds Free information."'
- option: path
value: /osm
- option: enabled
value: "{{ osm_enabled }}"