2020-01-26 10:34:24 +00:00
|
|
|
- name: Ensure directory {{ vector_map_path }}/maplist/assets exists
|
|
|
|
file:
|
2020-01-27 05:56:47 +00:00
|
|
|
path: "{{ vector_map_path }}/maplist/assets" # /library/www/osm-vector-maps
|
2020-01-26 10:34:24 +00:00
|
|
|
state: directory
|
2020-01-27 05:56:47 +00:00
|
|
|
owner: "{{ apache_user }}" # Typically 'www-data' or 'apache'
|
2020-01-26 10:34:24 +00:00
|
|
|
group: "{{ apache_user }}"
|
|
|
|
mode: '0755'
|
|
|
|
|
|
|
|
- name: Download map catalog {{ iiab_map_url }}/assets/regions.json to {{ vector_map_path }}/maplist/assets/
|
|
|
|
get_url:
|
2020-01-27 05:56:47 +00:00
|
|
|
url: "{{ iiab_map_url }}/assets/regions.json" # http://download.iiab.io/content/OSM/vector-tiles/maplist/hidden
|
|
|
|
dest: "{{ vector_map_path }}/maplist/assets/" # /library/www/osm-vector-maps
|
2020-01-26 10:34:24 +00:00
|
|
|
|
|
|
|
- name: Symlink catalog {{ doc_root }}/common/assets/regions.json -> {{ vector_map_path }}/maplist/assets/regions.json
|
|
|
|
file:
|
2020-01-27 05:56:47 +00:00
|
|
|
src: "{{ vector_map_path }}/maplist/assets/regions.json" # /library/www/osm-vector-maps
|
|
|
|
dest: "{{ doc_root }}/common/assets/regions.json" # /library/www/html
|
2020-01-26 10:34:24 +00:00
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Download the JavaScript bundle with OpenLayers (main.js) for test page http://box/maps/maplist
|
|
|
|
get_url:
|
2020-01-27 05:56:47 +00:00
|
|
|
url: "{{ iiab_map_url }}/../main.js" # http://download.iiab.io/content/OSM/vector-tiles/maplist/hidden
|
|
|
|
dest: "{{ vector_map_path }}/maplist/" # /library/www/osm-vector-maps
|
2020-01-26 10:34:24 +00:00
|
|
|
|
|
|
|
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist
|
|
|
|
template:
|
|
|
|
src: index.html
|
2020-01-27 05:56:47 +00:00
|
|
|
dest: "{{ vector_map_path }}/maplist/index.html" # /library/www/osm-vector-maps
|
2020-01-26 10:34:24 +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)
|
|
|
|
- name: Download bounding box definitions (bboxes.geojson) to {{ vector_map_path }}/maplist/assets/
|
|
|
|
get_url:
|
2020-01-27 05:56:47 +00:00
|
|
|
url: "{{ iiab_map_url }}/assets/bboxes.geojson" # http://download.iiab.io/content/OSM/vector-tiles/maplist/hidden
|
|
|
|
dest: "{{ vector_map_path }}/maplist/assets/" # /library/www/osm-vector-maps
|
2020-01-26 10:34:24 +00:00
|
|
|
|
|
|
|
- name: Install /usr/bin/iiab-update-map from template, for updating of Map Pack catalog & descriptions
|
|
|
|
template:
|
|
|
|
src: iiab-update-map
|
|
|
|
dest: /usr/bin/iiab-update-map
|
|
|
|
mode: '0755'
|
|
|
|
|
2020-01-27 05:56:47 +00:00
|
|
|
|
2020-01-27 06:27:46 +00:00
|
|
|
# 2020-01-27: See #2197 "OSM Install Errors" -- should the following 4 stanzas
|
2020-01-27 06:09:50 +00:00
|
|
|
# be restored to enable-or-disable.yml ? What fix is best short/long term?
|
2020-01-27 05:56:47 +00:00
|
|
|
|
2020-01-27 07:01:55 +00:00
|
|
|
- name: Copy countries.json (geojson) into {{ vector_map_path }}/maplist/assets/
|
2020-01-27 05:56:47 +00:00
|
|
|
copy:
|
|
|
|
src: countries.json
|
|
|
|
dest: "{{ vector_map_path }}/maplist/assets" # /library/www/osm-vector-maps
|
|
|
|
|
|
|
|
# It is too complicated to use a single file for both iiab and admin-console
|
2020-01-27 07:01:55 +00:00
|
|
|
- name: Copy map_functions.js (duplicated JavaScript) into {{ vector_map_path }}/maplist/assets/
|
2020-01-27 05:56:47 +00:00
|
|
|
copy:
|
|
|
|
src: map_functions.js
|
|
|
|
dest: "{{ vector_map_path }}/maplist/assets" # /library/www/osm-vector-maps
|
|
|
|
|
2020-01-27 07:01:55 +00:00
|
|
|
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist/
|
2020-01-27 05:56:47 +00:00
|
|
|
template:
|
|
|
|
src: index.html
|
|
|
|
dest: "{{ vector_map_path }}/maplist/index.html" # /library/www/osm-vector-maps
|
|
|
|
|
2020-01-27 07:01:55 +00:00
|
|
|
- name: "Copy test-index.redirect to {{ vector_map_path }}/index.html, for redirect: http://box/maps/ -> http://box/osm-vector-maps/"
|
2020-01-27 06:27:46 +00:00
|
|
|
copy:
|
|
|
|
force: no
|
|
|
|
src: test-index.redirect
|
|
|
|
dest: "{{ vector_map_path }}/index.html" # /library/www/osm-vector-maps
|
|
|
|
|
2020-01-27 05:56:47 +00:00
|
|
|
|
2020-01-26 10:34:24 +00:00
|
|
|
- name: "Add 'osm_vector_maps_installed: True' to {{ iiab_state_file }}"
|
|
|
|
lineinfile:
|
|
|
|
dest: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml
|
|
|
|
regexp: '^osm_vector_maps_installed'
|
|
|
|
line: 'osm_vector_maps_installed: True'
|