2019-05-06 01:51:34 +00:00
|
|
|
- name: Make sure the vector-maps directory exists
|
2019-04-02 20:18:18 +00:00
|
|
|
file:
|
2019-05-05 06:04:32 +00:00
|
|
|
path: '{{ vector_map_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:
|
2019-05-06 03:41:48 +00:00
|
|
|
url: "{{ iiab_map_url }}/assets/regions.json"
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_path }}/maplist/assets/'
|
2019-04-08 14:45:55 +00:00
|
|
|
|
2019-04-04 19:35:28 +00:00
|
|
|
- name: Create a link to osm catalog in /common/assets
|
|
|
|
file:
|
2019-05-05 06:04:32 +00:00
|
|
|
src: "{{ vector_map_path }}/maplist/assets/regions.json"
|
2019-04-16 16:57:45 +00:00
|
|
|
dest: "{{ doc_root }}/common/assets/regions.json"
|
|
|
|
state: link
|
2019-04-04 19:35:28 +00:00
|
|
|
|
2019-04-02 20:18:18 +00:00
|
|
|
- name: Fetch the javascript bundle with openlayers for test page
|
|
|
|
get_url:
|
2019-05-06 03:41:48 +00:00
|
|
|
url: "{{ iiab_map_url }}/../main.js"
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_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-16 16:57:45 +00:00
|
|
|
src: "index.html"
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_path }}/maplist/index.html'
|
2019-03-18 04:45:33 +00:00
|
|
|
|
2019-04-16 16:57:45 +00:00
|
|
|
# Bboxes (bounding boxes) 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
|
2019-03-19 04:36:23 +00:00
|
|
|
get_url:
|
2019-05-06 03:41:48 +00:00
|
|
|
url: "{{ iiab_map_url }}/assets/bboxes.geojson"
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_path }}/maplist/assets/'
|
2019-03-19 04:36:23 +00:00
|
|
|
|
2019-04-16 16:57:45 +00:00
|
|
|
- name: Install python-geojson package, that helps with geojson
|
2019-04-03 16:52:22 +00:00
|
|
|
package:
|
2019-04-16 16:57:45 +00:00
|
|
|
name: python-geojson
|
2019-04-03 16:52:22 +00:00
|
|
|
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-05-06 03:41:48 +00:00
|
|
|
src: iiab-update-map
|
|
|
|
dest: /usr/bin/iiab-update-map
|
2019-03-18 04:45:33 +00:00
|
|
|
mode: "0755"
|
|
|
|
|
2019-05-06 01:51:34 +00:00
|
|
|
- name: Run the script that does vector-maps housekeeping
|
2019-05-06 03:41:48 +00:00
|
|
|
shell: /usr/bin/iiab-update-map
|
2019-03-18 04:45:33 +00:00
|
|
|
|
|
|
|
- name: Copy the Countries geojson to assets
|
|
|
|
copy:
|
|
|
|
src: countries.json
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_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:
|
2019-05-06 03:41:48 +00:00
|
|
|
src: map_functions.js
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: '{{ vector_map_path }}/maplist/assets'
|
2019-03-18 04:45:33 +00:00
|
|
|
|
2019-05-06 03:41:48 +00:00
|
|
|
- name: Install /etc/{{ apache_config_dir }}/vector-maps.conf from template
|
2019-03-18 04:45:33 +00:00
|
|
|
template:
|
2019-05-06 01:51:34 +00:00
|
|
|
src: vector-maps.conf
|
|
|
|
dest: "/etc/{{ apache_config_dir }}/vector-maps.conf"
|
2019-03-18 04:45:33 +00:00
|
|
|
|
2019-05-06 01:51:34 +00:00
|
|
|
- name: Create symlink vector-maps.conf from sites-enabled to sites-available (debuntu, not nec for redhat)
|
2019-03-18 04:45:33 +00:00
|
|
|
file:
|
2019-05-06 01:51:34 +00:00
|
|
|
src: /etc/apache2/sites-available/vector-maps.conf
|
|
|
|
path: /etc/apache2/sites-enabled/vector-maps.conf
|
2019-03-18 04:45:33 +00:00
|
|
|
state: link
|
2019-05-06 02:05:32 +00:00
|
|
|
when: vector_maps_enabled and is_debuntu
|
2019-03-18 04:45:33 +00:00
|
|
|
|
2019-05-06 01:51:34 +00:00
|
|
|
- name: Remove symlink /etc/apache2/sites-enabled/vector-maps.conf (debuntu)
|
2019-03-18 04:45:33 +00:00
|
|
|
file:
|
2019-05-06 01:51:34 +00:00
|
|
|
path: /etc/apache2/sites-enabled/vector-maps.conf
|
2019-03-18 04:45:33 +00:00
|
|
|
state: absent
|
2019-05-06 02:05:32 +00:00
|
|
|
when: not vector_maps_enabled and is_debuntu
|
2019-03-18 04:45:33 +00:00
|
|
|
|
2019-04-08 23:24:39 +00:00
|
|
|
- name: Copy the redirect to the test page -- delete this if more than one map
|
2019-03-19 04:36:23 +00:00
|
|
|
copy:
|
2019-04-03 19:11:32 +00:00
|
|
|
src: test-index.redirect
|
2019-05-05 06:04:32 +00:00
|
|
|
dest: "{{ vector_map_path }}/index.html"
|
2019-03-18 04:45:33 +00:00
|
|
|
|