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

102 lines
3.1 KiB
YAML
Raw Normal View History

2019-04-02 20:18:18 +00:00
- name: Make sure the osm-vector directory exists
file:
2019-04-08 14:45:55 +00:00
path: '{{ osm_vector_path }}/maplist/assets'
2019-04-02 20:18:18 +00:00
state: directory
owner: '{{ apache_user }}'
group: '{{ apache_user }}'
mode: '0755'
2019-04-08 14:45:55 +00:00
- name: Fetch the catalog for osm maps
get_url:
url: "{{ iiab_osm_url }}/assets/regions.json"
dest: '{{ osm_vector_path }}/maplist/assets/'
2019-04-04 19:35:28 +00:00
- name: Create a link to osm catalog in /common/assets
file:
2019-04-08 14:50:01 +00:00
src: "{{ osm_vector_path }}/maplist/assets/regions.json"
2019-04-04 19:35:28 +00:00
dest: "{{ doc_root }}/common/assets/regions.json"
state: link
2019-04-02 20:18:18 +00:00
- name: Fetch the javascript bundle with openlayers for test page
get_url:
2019-04-10 17:55:57 +00:00
url: "{{ iiab_osm_url }}/../main.js"
2019-04-08 14:45:55 +00:00
dest: '{{ osm_vector_path }}/maplist/'
2019-04-02 20:18:18 +00:00
- name: Fetch the index.html for test page
2019-04-03 19:11:32 +00:00
template:
2019-04-04 00:23:03 +00:00
src: "index.html"
2019-04-08 14:45:55 +00:00
dest: '{{ osm_vector_path }}/maplist/index.html'
2019-03-18 04:45:33 +00:00
2019-04-08 23:24:39 +00:00
# Bboxes are currently square. But geofabrik has non-rectangular bboxes
# So bring the bounding box definition from cloud (bboxes.geojson is big)
2019-04-01 03:18:46 +00:00
- name: Fetch the bounding box description for osm maps
get_url:
url: "{{ iiab_osm_url }}/assets/bboxes.geojson"
2019-04-08 14:45:55 +00:00
dest: '{{ osm_vector_path }}/maplist/assets/'
2019-04-03 16:52:22 +00:00
- name: Install a package that helps with geojson
package:
name:
- python-geojson
state: present
2019-04-01 03:18:46 +00:00
- name: Install the script to update osm catalog
2019-03-18 04:45:33 +00:00
template:
2019-04-01 03:18:46 +00:00
src: iiab-update-osm
dest: /usr/bin/iiab-update-osm
2019-03-18 04:45:33 +00:00
mode: "0755"
2019-04-02 20:18:18 +00:00
- name: Run the script that does osm-vector housekeeping
2019-04-01 03:18:46 +00:00
shell: /usr/bin/iiab-update-osm
2019-03-18 04:45:33 +00:00
- name: Copy the Countries geojson to assets
copy:
src: countries.json
2019-04-08 14:45:55 +00:00
dest: '{{ osm_vector_path }}/maplist/assets'
2019-04-02 20:18:18 +00:00
# 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
2019-04-08 14:45:55 +00:00
dest: '{{ osm_vector_path }}/maplist/assets'
2019-03-18 04:45:33 +00:00
- 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
2019-04-08 23:24:39 +00:00
- name: Copy the redirect to the test page -- delete this if more than one map
copy:
2019-04-03 19:11:32 +00:00
src: test-index.redirect
2019-03-18 04:45:33 +00:00
dest: "{{ osm_vector_path }}/index.html"
2019-04-08 22:39:17 +00:00
- name: Create a directory for map menu-def
file:
path: '{{ menu_def_dir }}'
state: directory
2019-04-03 16:50:25 +00:00
- name: Determine status of splash menu def
stat:
path: '{{ menu_def_dir }}/en-map_test.json'
2019-04-08 22:39:17 +00:00
ignore_errors: True
2019-04-03 16:50:25 +00:00
register: menu_def
- name: Do not overwrite if it already exists
copy:
src: en-map_test.json
dest: '{{ menu_def_dir }}/en-map_test.json'
when: menu_def.stat.exists is defined and not menu_def.stat.exists