- name: Make ~5 directories in {{ vector_map_path }} (0755 by default) file: path: "{{ item }}" state: directory # mode: 0755 with_items: - "{{ vector_map_path }}/test-page/assets" # /library/www/osm-vector-maps - "{{ vector_map_path }}/maplist/assets" - "{{ vector_map_path }}/viewer/assets" - "{{ vector_map_path }}/viewer/tiles" - "{{ vector_map_path }}/installer" - name: Download {{ map_catalog_url }}/map-catalog.json to {{ iiab_etc_path }} get_url: url: "{{ map_catalog_url }}/map-catalog.json" # http://download.iiab.io/content/OSM/vector-tiles dest: "{{ iiab_etc_path }}" # /etc/iiab - name: Download {{ iiab_map_url }}/assets/regions.json to {{ iiab_etc_path }} get_url: url: "{{ iiab_map_url }}/assets/regions.json" # http://download.iiab.io/content/OSM/vector-tiles/maplist/hidden dest: "{{ iiab_etc_path }}" - name: Does cities database {{ vector_map_path }}/cities1000.sqlite exist? stat: path: "{{ vector_map_path }}/cities1000.sqlite" register: cities_installed - name: If not, download {{ iiab_map_url }}/regional-resources/cities1000.sqlite to {{ vector_map_path }}/viewer/ get_url: url: "{{ iiab_map_url }}/regional-resources/cities1000.sqlite" dest: "{{ vector_map_path }}/viewer/" when: not cities_installed.stat.exists - name: Symlink {{ doc_root }}/common/assets/map-catalog.json -> /etc/iiab/map-catalog.json file: src: /etc/iiab/map-catalog.json path: "{{ doc_root }}/common/assets/map-catalog.json" # /library/www/html state: link - name: Symlink {{ vector_map_path }}/test-page/assets/map-catalog.json -> /etc/iiab/map-catalog.json file: src: /etc/iiab/map-catalog.json path: "{{ vector_map_path }}/test-page/assets/map-catalog.json" state: link - name: Symlink {{ vector_map_path }}/maplist/assets/regions.json -> /etc/iiab/regions.json file: src: /etc/iiab/regions.json path: "{{ vector_map_path }}/maplist/assets/regions.json" state: link # At this point, fetches from github.com/georgejhunt/maps from test branch - name: Download OpenLayers test page stuff (JavaScript bundle etc) from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/test-page/build/* to {{ vector_map_path }}/test-page/ -- for test page http://box/maps/maplist get_url: url: "{{ item }}" dest: "{{ vector_map_path }}/test-page/" with_items: - "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/test-page/build/test-page-bundle.js" # https://raw.githubusercontent.com/iiab/maps / master - "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/test-page/build/index.html" - name: Download OpenLayers viewer page stuff (JavaScript bundle etc) from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/build/* to {{ vector_map_path }}/viewer/ # At this point, fetches from github.com/iiab/maps from {{ maps_branch }} branch get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/build/{{ item }}" dest: "{{ vector_map_path }}/viewer/" with_items: - index.html - viewer-bundle.js - viewer-bundle.js.map - name: Download ~4 .css and .php helper files from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/* to {{ vector_map_path }}/viewer/ -- for viewer get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/{{ item }}" dest: "{{ vector_map_path }}/viewer/" with_items: - mbtileinfo.php - popup.css - searchapi.php - tileserver.php - name: Download {{ map_catalog_url }}/planet_z0-z6_2019.mbtiles to {{ vector_map_path }}/installer/ -- for map installer get_url: url: "{{ map_catalog_url }}/planet_z0-z6_2019.mbtiles" dest: "{{ vector_map_path }}/installer/" - name: Symlink {{ vector_map_path }}/installer/detail.mbtiles -> {{ vector_map_path }}/installer/planet_z0-z6_2019.mbtiles file: src: "{{ vector_map_path }}/installer/planet_z0-z6_2019.mbtiles" path: "{{ vector_map_path }}/installer/detail.mbtiles" state: link - name: Symlink {{ vector_map_path }}/viewer/tiles/planet_z0-z6_2019.mbtiles -> {{ vector_map_path }}/installer/planet_z0-z6_2019.mbtiles file: src: "{{ vector_map_path }}/installer/planet_z0-z6_2019.mbtiles" path: "{{ vector_map_path }}/viewer/tiles/planet_z0-z6_2019.mbtiles" state: link - name: Download abbreviated satellite images from {{ map_catalog_url }}/satellite_z0-z6_v3.mbtiles to {{ vector_map_path }}/viewer/tiles/ get_url: url: "{{ map_catalog_url }}/satellite_z0-z6_v3.mbtiles" dest: "{{ vector_map_path }}/viewer/tiles/" - name: Download {index.html, installer-bundle.js} from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/installer/build/* to {{ vector_map_path }}/installer/ -- for map installer get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/installer/build/{{ item }}" dest: "{{ vector_map_path }}/installer/" with_items: - index.html - installer-bundle.js - name: Download ~4 action routines from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/installer/* to {{ vector_map_path }}/installer/ -- for installer get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/installer/{{ item }}" dest: "{{ vector_map_path }}/installer/" with_items: - map.css - style-osm.json - installer-functions.js - tileserver.php # the following was changed to grab from the iiab/maps repo - name: Download common assets from {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/assets/* to {{ vector_map_path }}/viewer/assets -- for the general purpose map viewer get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/assets/{{ item }}" dest: "{{ vector_map_path }}/viewer/assets" with_items: - bboxes.geojson - center.png - countries.json - fonts.css - ol-layerswitcher.css - ol-contextmenu.css - pin_drop.png - sprite@2x.json - sprite@2x.png - sprite.json - sprite.png - style-cdn.json - style-osm.json - style-sat.json - view_list.png - name: Symlink {{ vector_map_path }}/maplist/assets/bboxes.geojson -> {{ vector_map_path }}/viewer/assets/bboxes.geojson for Admin Console file: src: "{{ vector_map_path }}/viewer/assets/bboxes.geojson" path: "{{ vector_map_path }}/maplist/assets/bboxes.geojson" state: link force: True - name: Symlink {{ vector_map_path }}/maplist/assets/countries.json -> {{ vector_map_path }}/viewer/assets/countries.json for Admin Console file: src: "{{ vector_map_path }}/viewer/assets/countries.json" path: "{{ vector_map_path }}/maplist/assets/countries.json" state: link force: True - name: Copy fonts to {{ doc_root }}/common/fonts/ for the general purpose map viewer (root:root, 0644 by default) copy: src: "{{ item }}" dest: "{{ doc_root }}/common/fonts/" # mode: 0644 # owner: root # group: root with_fileglob: - fonts/* - name: Copy redirect {{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/installer-index.redirect to test page {{ vector_map_path }}/maplist/index.html get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/installer-index.redirect" dest: "{{ vector_map_path }}/maplist/index.html" force: yes - name: "Install packages for map installation: python3-wget, php{{ php_version }}-sqlite3, python3-geojson, python3-pil" package: state: present name: - python3-wget #- php{{ php_version }}-common # Auto-installed as an apt dependency. REGARDLESS: php{{ php_version }}-common superset php{{ php_version }}-cli is auto-installed by php{{ php_version }}-fpm in nginx/tasks/install.yml - php{{ php_version }}-sqlite3 - python3-geojson - python3-pil - name: Copy 6 scripts to /usr/bin, for downloading tiles (0755) get_url: url: "{{ osm_repo_url }}/{{ maps_branch }}/osm-source/pages/viewer/scripts/{{ item }}" dest: /usr/bin/ mode: 0755 with_items: - iiab-install-map-region - iiab-extend-sat.py - iiab-summarize.sh - iiab-maps-finish.py - iiab-make-init.py - iiab-update-map # RECORD OSM Vector Maps AS INSTALLED - name: "Set 'osm_vector_maps_installed: True'" set_fact: osm_vector_maps_installed: True - name: "Add 'osm_vector_maps_installed: True' to {{ iiab_state_file }}" lineinfile: path: "{{ iiab_state_file }}" # /etc/iiab/iiab_state.yml regexp: '^osm_vector_maps_installed' line: 'osm_vector_maps_installed: True'