1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-02-13 19:52:06 +00:00
iiab/roles/osm-vector/tasks/main.yml
2019-04-03 17:52:22 +01:00

77 lines
2.2 KiB
YAML

- name: Fetch the catalog for osm maps
get_url:
url: "{{ iiab_osm_url }}/regions.json"
dest: '{{ doc_root }}/common/assets'
- name: Make sure the osm-vector directory exists
file:
path: '{{ osm_vector_path }}/assets'
state: directory
owner: '{{ apache_user }}'
group: '{{ apache_user }}'
mode: '0755'
- name: Fetch the javascript bundle with openlayers for test page
get_url:
url: "{{ iiab_osm_url }}/main.js"
dest: '{{ osm_vector_path }}/assets'
- name: Fetch the index.html for test page
get_url:
url: "{{ iiab_osm_url }}/index.html"
dest: '{{ osm_vector_path }}/assets'
- name: Fetch the bounding box description for osm maps
get_url:
url: "{{ iiab_osm_url }}/bboxes.geojson"
dest: '{{ osm_vector_path }}/assets'
- name: Install a package that helps with geojson
package:
name:
- python-geojson
state: present
- name: Install the script to update osm catalog
template:
src: iiab-update-osm
dest: /usr/bin/iiab-update-osm
mode: "0755"
- name: Run the script that does osm-vector housekeeping
shell: /usr/bin/iiab-update-osm
- name: Copy the Countries geojson to assets
copy:
src: countries.json
dest: '{{ osm_vector_path }}/assets'
# It is too complicated to use a single file for both iiab and admin-console
- name: Copy the duplicated javascript to assets
copy:
src: osm_functions.js
dest: '{{ osm_vector_path }}/assets'
- name: Install /etc/{{ apache_config_dir }}/osm-vect.conf from template
template:
src: osm-vector.conf
dest: "/etc/{{ apache_config_dir }}/osm-vector.conf"
- name: Create symlink osm-vector.conf from sites-enabled to sites-available (debuntu, not nec for redhat)
file:
src: /etc/apache2/sites-available/osm-vector.conf
path: /etc/apache2/sites-enabled/osm-vector.conf
state: link
when: osm_vector_enabled and is_debuntu
- name: Remove symlink /etc/apache2/sites-enabled/osm-vector.conf (debuntu)
file:
path: /etc/apache2/sites-enabled/osm-vector.conf
state: absent
when: not osm_vector_enabled and is_debuntu
- name: Copy the php redirect to the splash page
copy:
src: splash-index.redirect
dest: "{{ osm_vector_path }}/index.html"