mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			74 lines
		
	
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
	
		
			3.5 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
- name: Ensure directory {{ vector_map_path }}/maplist/assets exists
 | 
						|
  file:
 | 
						|
    path: "{{ vector_map_path }}/maplist/assets"    # /library/www/osm-vector-maps
 | 
						|
    state: directory
 | 
						|
    owner: "{{ apache_user }}"    # Typically 'www-data' or 'apache'
 | 
						|
    group: "{{ apache_user }}"
 | 
						|
    mode: '0755'
 | 
						|
 | 
						|
- name: Download map catalog {{ iiab_map_url }}/assets/regions.json to {{ vector_map_path }}/maplist/assets/
 | 
						|
  get_url:
 | 
						|
    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
 | 
						|
 | 
						|
- name: Symlink catalog {{ doc_root }}/common/assets/regions.json -> {{ vector_map_path }}/maplist/assets/regions.json
 | 
						|
  file:
 | 
						|
    src: "{{ vector_map_path }}/maplist/assets/regions.json"    # /library/www/osm-vector-maps
 | 
						|
    dest: "{{ doc_root }}/common/assets/regions.json"    # /library/www/html
 | 
						|
    state: link
 | 
						|
 | 
						|
- name: Download the JavaScript bundle with OpenLayers (main.js) into {{ vector_map_path }}/maplist/, for test page http://box/maps/maplist
 | 
						|
  get_url:
 | 
						|
    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
 | 
						|
 | 
						|
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist/
 | 
						|
  template:
 | 
						|
    src: index.html
 | 
						|
    dest: "{{ vector_map_path }}/maplist/index.html"    # /library/www/osm-vector-maps
 | 
						|
 | 
						|
# 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:
 | 
						|
    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
 | 
						|
 | 
						|
- 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: See #2197 "OSM Install Errors" -- should the following 4 stanzas
 | 
						|
# be restored to enable-or-disable.yml ?  What fix is best short/long term?
 | 
						|
 | 
						|
- name: Copy countries.json (geojson) into {{ vector_map_path }}/maplist/assets/
 | 
						|
  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
 | 
						|
- name: Copy map_functions.js (duplicated JavaScript) into {{ vector_map_path }}/maplist/assets/
 | 
						|
  copy:
 | 
						|
    src: map_functions.js
 | 
						|
    dest: "{{ vector_map_path }}/maplist/assets"    # /library/www/osm-vector-maps
 | 
						|
 | 
						|
- name: Install {{ vector_map_path }}/maplist/index.html from template, for test page http://box/maps/maplist/
 | 
						|
  template:
 | 
						|
    src: index.html
 | 
						|
    dest: "{{ vector_map_path }}/maplist/index.html"    # /library/www/osm-vector-maps
 | 
						|
 | 
						|
- name: "Copy test-index.redirect to {{ vector_map_path }}/index.html, for interim redirect: http://box/maps/ -> http://box/osm-vector-maps/maplist/"
 | 
						|
  copy:
 | 
						|
    force: no
 | 
						|
    src: test-index.redirect
 | 
						|
    dest: "{{ vector_map_path }}/index.html"    # /library/www/osm-vector-maps
 | 
						|
 | 
						|
 | 
						|
- 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'
 |