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-maps/tasks/main.yml

101 lines
3.8 KiB
YAML
Raw Normal View History

2019-06-28 22:59:05 +00:00
- name: Ensure directory {{ vector_map_path }}/maplist/assets exists
2019-05-19 16:53:55 +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-06-29 18:23:00 +00:00
- name: Download map catalog {{ iiab_map_url }}/assets/regions.json to {{ vector_map_path }}/maplist/assets/
2019-04-08 14:45:55 +00:00
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-06-28 22:59:05 +00:00
- name: Symlink catalog {{ doc_root }}/common/assets/regions.json -> {{ vector_map_path }}/maplist/assets/regions.json
2019-04-04 19:35:28 +00:00
file:
2019-05-05 06:04:32 +00:00
src: "{{ vector_map_path }}/maplist/assets/regions.json"
dest: "{{ doc_root }}/common/assets/regions.json"
state: link
2019-04-04 19:35:28 +00:00
2019-06-28 23:12:48 +00:00
- name: Download the JavaScript bundle with OpenLayers (main.js) for test page http://box/maps/maplist
2019-04-02 20:18:18 +00:00
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
2019-06-29 18:23:00 +00:00
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist
2019-04-03 19:11:32 +00:00
template:
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
# 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-06-29 18:23:00 +00:00
- name: Download bounding box definitions (bboxes.geojson) to {{ vector_map_path }}/maplist/assets/
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/'
# REMOVE this stanza once the transition to Python 3 is confirmed
2019-11-18 15:43:37 +00:00
#- name: Install python-geojson package (OS's prior to Ubuntu 19.10)
# package:
# name: python-geojson
# state: present
# when: is_raspbian_9 or is_raspbian_10 or is_ubuntu_16 or is_ubuntu_18 or is_debian_9 or is_debian_10
# 2019-10-19: Above python-geojson does not exist on Ubuntu 19.10, so let's
2019-11-18 15:43:37 +00:00
# begin the transition to Python 3... currently unused
#- name: Install python3-geojson package (especially for new OS's like Ubuntu 19.10+)
# package:
# name: python3-geojson # 2019-10-19: available across most/all recent
# state: present # OS's, but not yet used by osm-vector-maps code?
2019-04-03 16:52:22 +00:00
2019-07-06 18:07:50 +00:00
- name: Install /usr/bin/iiab-update-map for updating of Map Pack catalog & descriptions
2019-03-18 04:45:33 +00:00
template:
2019-11-29 15:34:52 +00:00
src: iiab-update-map
2019-05-06 03:41:48 +00:00
dest: /usr/bin/iiab-update-map
2019-03-18 04:45:33 +00:00
mode: "0755"
2019-05-19 16:53:55 +00:00
# This depends on iiab-admin-console which is not yet installed
#- name: Run the script that does osm-vector-maps housekeeping
# shell: /usr/bin/iiab-update-map
2019-06-28 22:59:05 +00:00
- name: Copy countries.json (geojson) to {{ vector_map_path }}/maplist/assets
2019-05-19 16:53:55 +00:00
copy:
2019-03-18 04:45:33 +00:00
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
2019-06-28 22:59:05 +00:00
- name: Copy the duplicated JavaScript (map_functions.js) to {{ vector_map_path }}/maplist/assets
2019-05-19 16:53:55 +00:00
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
- name: Install {{ nginx_config_dir }}/osm-vector-maps.conf from template
2019-03-18 04:45:33 +00:00
template:
src: osm-vector-maps-nginx.conf
dest: "{{ nginx_config_dir }}/osm-vector-maps-nginx.conf"
when: osm_vector_maps_enabled
2019-03-18 04:45:33 +00:00
- name: Remove {{ nginx_config_dir }}/osm-vector-maps.conf (debuntu)
2019-03-18 04:45:33 +00:00
file:
path: "{{ nginx_config_dir }}/osm-vector-maps-nginx.conf"
2019-03-18 04:45:33 +00:00
state: absent
when: not osm_vector_maps_enabled
2019-03-18 04:45:33 +00:00
2019-07-08 01:47:01 +00:00
#- name: Does the {{ vector_map_path }}/index.html redirect already exist?
# stat:
# path: "{{ vector_map_path }}/index.html"
# register: osm_redirect
#Copy the redirect to the test page -- delete this later if more than one map
2019-07-08 01:47:01 +00:00
- name: Install {{ vector_map_path }}/index.html redirect for http://box/maps -> http://box/osm-vector-maps/maplist/ if no redirect exists
2019-05-19 16:53:55 +00:00
copy:
2019-07-08 01:47:01 +00:00
force: no
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-07-08 01:47:01 +00:00
#when: not osm_redirect.stat.exists
- name: Reload nginx
systemd:
name: nginx
state: reloaded