From ba071002200648841d07a63f87734b287558bad9 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 6 May 2019 07:23:16 -0700 Subject: [PATCH 1/4] ->osm-vector-maps --- roles/4-server-options/tasks/main.yml | 4 ++-- roles/vector-maps/defaults/main.yml | 6 ++--- roles/vector-maps/files/map_functions.js | 4 ++-- roles/vector-maps/files/test-index.redirect | 2 +- roles/vector-maps/tasks/main.yml | 24 ++++++++++---------- roles/vector-maps/templates/iiab-update-map | 4 ++-- roles/vector-maps/templates/index.html | 4 ++-- roles/vector-maps/templates/vector-maps.conf | 2 +- vars/default_vars.yml | 6 ++--- vars/local_vars_big.yml | 4 ++-- vars/local_vars_medium.yml | 4 ++-- vars/local_vars_min.yml | 4 ++-- 12 files changed, 34 insertions(+), 34 deletions(-) diff --git a/roles/4-server-options/tasks/main.yml b/roles/4-server-options/tasks/main.yml index 8da054002..8974085e3 100644 --- a/roles/4-server-options/tasks/main.yml +++ b/roles/4-server-options/tasks/main.yml @@ -15,8 +15,8 @@ - name: Installing vector map test page include_role: - name: vector-maps - when: vector_maps_install + name: osm-vector-maps + when: osm_vector_maps_install tags: base, map - name: Installing captive portal diff --git a/roles/vector-maps/defaults/main.yml b/roles/vector-maps/defaults/main.yml index 9679a6337..07882b688 100644 --- a/roles/vector-maps/defaults/main.yml +++ b/roles/vector-maps/defaults/main.yml @@ -1,6 +1,6 @@ -vector_maps_install: True -vector_maps_enabled: True -vector_map_path: '{{ content_base }}/www/vector-maps' +osm_vector_maps_install: True +osm_vector_maps_enabled: True +vector_map_path: '{{ content_base }}/www/osm-vector-maps' # All above are set in: github.com/iiab/iiab/blob/master/vars/default_vars.yml # If nec, change them by editing /etc/iiab/local_vars.yml prior to installing! diff --git a/roles/vector-maps/files/map_functions.js b/roles/vector-maps/files/map_functions.js index 956ca01ac..23ab66746 100644 --- a/roles/vector-maps/files/map_functions.js +++ b/roles/vector-maps/files/map_functions.js @@ -7,7 +7,7 @@ var regionGeojson = {}; var regionList = []; var regionInstalled = []; var commonAssetsDir = '/common/assets/'; -var mapAssetsDir = '/vector-maps/maplist/assets/'; +var mapAssetsDir = '/osm-vector-maps/maplist/assets/'; var iiab_config_dir = '/etc/iiab/'; var onChangeFunc = "setSize"; var mapCatalog = {}; @@ -27,7 +27,7 @@ function readOsmIdx(){ //consoleLog ("in readOsmIdx"); var resp = $.ajax({ type: 'GET', - url: consoleJsonDir + 'vector-maps-idx.json', + url: consoleJsonDir + 'osm-vector-maps-idx.json', dataType: 'json' }) .done(function( data ) { diff --git a/roles/vector-maps/files/test-index.redirect b/roles/vector-maps/files/test-index.redirect index 3d86d5480..9ad3694cc 100644 --- a/roles/vector-maps/files/test-index.redirect +++ b/roles/vector-maps/files/test-index.redirect @@ -1,4 +1,4 @@ - + diff --git a/roles/vector-maps/tasks/main.yml b/roles/vector-maps/tasks/main.yml index 7cc56e962..ca3cd9276 100644 --- a/roles/vector-maps/tasks/main.yml +++ b/roles/vector-maps/tasks/main.yml @@ -1,4 +1,4 @@ -- name: Make sure the vector-maps directory exists +- name: Make sure the osm-vector-maps directory exists file: path: '{{ vector_map_path }}/maplist/assets' state: directory @@ -45,7 +45,7 @@ dest: /usr/bin/iiab-update-map mode: "0755" -- name: Run the script that does vector-maps housekeeping +- name: Run the script that does osm-vector-maps housekeeping shell: /usr/bin/iiab-update-map - name: Copy the Countries geojson to assets @@ -59,23 +59,23 @@ src: map_functions.js dest: '{{ vector_map_path }}/maplist/assets' -- name: Install /etc/{{ apache_config_dir }}/vector-maps.conf from template +- name: Install /etc/{{ apache_config_dir }}/osm-vector-maps.conf from template template: - src: vector-maps.conf - dest: "/etc/{{ apache_config_dir }}/vector-maps.conf" + src: osm-vector-maps.conf + dest: "/etc/{{ apache_config_dir }}/osm-vector-maps.conf" -- name: Create symlink vector-maps.conf from sites-enabled to sites-available (debuntu, not nec for redhat) +- name: Create symlink osm-vector-maps.conf from sites-enabled to sites-available (debuntu, not nec for redhat) file: - src: /etc/apache2/sites-available/vector-maps.conf - path: /etc/apache2/sites-enabled/vector-maps.conf + src: /etc/apache2/sites-available/osm-vector-maps.conf + path: /etc/apache2/sites-enabled/osm-vector-maps.conf state: link - when: vector_maps_enabled and is_debuntu + when: osm_vector_maps_enabled and is_debuntu -- name: Remove symlink /etc/apache2/sites-enabled/vector-maps.conf (debuntu) +- name: Remove symlink /etc/apache2/sites-enabled/osm-vector-maps.conf (debuntu) file: - path: /etc/apache2/sites-enabled/vector-maps.conf + path: /etc/apache2/sites-enabled/osm-vector-maps.conf state: absent - when: not vector_maps_enabled and is_debuntu + when: not osm_vector_maps_enabled and is_debuntu - name: Copy the redirect to the test page -- delete this if more than one map copy: diff --git a/roles/vector-maps/templates/iiab-update-map b/roles/vector-maps/templates/iiab-update-map index bebb8d81a..23a5869c3 100755 --- a/roles/vector-maps/templates/iiab-update-map +++ b/roles/vector-maps/templates/iiab-update-map @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Scan the vector-maps directory, update the vector-maps-idx.json, add menu-defs +# Scan the osm-vector-maps directory, update the osm-vector-maps-idx.json, add menu-defs from geojson import Feature, Point, FeatureCollection, Polygon import geojson @@ -27,7 +27,7 @@ doc_root = get_iiab_env('WWWROOT') menuDefs = doc_root + "/js-menu/menu-files/menu-defs/" vector_map_idx_dir = doc_root + "/common/assets" #map_doc_root = '{{ vector_map_path }}' -map_doc_root = '/library/www/vector-maps' +map_doc_root = '/library/www/osm-vector-maps' # map_catalog will be global, assumed always available map_catalog = {} map_menu_def_list = [] diff --git a/roles/vector-maps/templates/index.html b/roles/vector-maps/templates/index.html index 3e6123818..62615ae84 100644 --- a/roles/vector-maps/templates/index.html +++ b/roles/vector-maps/templates/index.html @@ -46,12 +46,12 @@ return (bytes / Math.pow(1024, e)).toFixed(2) + " " + s[e]; } - + - + diff --git a/roles/vector-maps/templates/vector-maps.conf b/roles/vector-maps/templates/vector-maps.conf index dd3d32050..765de9874 100644 --- a/roles/vector-maps/templates/vector-maps.conf +++ b/roles/vector-maps/templates/vector-maps.conf @@ -1,6 +1,6 @@ # For downloadable regional vector tilesets Alias /maps {{ vector_map_path }} -Alias /vector-maps {{ vector_map_path }} +Alias /osm-vector-maps {{ vector_map_path }} Options Indexes FollowSymLinks AllowOverride All diff --git a/vars/default_vars.yml b/vars/default_vars.yml index e610ce4f2..fe5c32155 100644 --- a/vars/default_vars.yml +++ b/vars/default_vars.yml @@ -352,9 +352,9 @@ mongodb_enabled: False mongodb_port: 27018 # Regional OSM vector maps use much less disk space than bitmap/raster versions -vector_maps_install: True -vector_maps_enabled: True -vector_map_path: '{{ content_base }}/www/vector-maps' +osm_vector_maps_install: True +osm_vector_maps_enabled: True +vector_map_path: '{{ content_base }}/www/osm-vector-maps' # roles/sugarizer/meta/main.yml auto-invokes 2 above prereqs: mongodb & nodejs # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 diff --git a/vars/local_vars_big.yml b/vars/local_vars_big.yml index a4db50618..016feb675 100644 --- a/vars/local_vars_big.yml +++ b/vars/local_vars_big.yml @@ -230,8 +230,8 @@ moodle_enabled: True # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -vector_maps_install: True -vector_maps_enabled: True +osm_vector_maps_install: True +osm_vector_maps_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 diff --git a/vars/local_vars_medium.yml b/vars/local_vars_medium.yml index a36c7db6e..42ce9030d 100644 --- a/vars/local_vars_medium.yml +++ b/vars/local_vars_medium.yml @@ -230,8 +230,8 @@ moodle_enabled: False # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -vector_maps_install: True -vector_maps_enabled: True +osm_vector_maps_install: True +osm_vector_maps_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 diff --git a/vars/local_vars_min.yml b/vars/local_vars_min.yml index 548d7adc9..66384a974 100644 --- a/vars/local_vars_min.yml +++ b/vars/local_vars_min.yml @@ -230,8 +230,8 @@ moodle_enabled: False # If using Moodle intensively, set apache_high_php_limits in 3-BASE-SERVER # Regional OSM vector maps use much less disk space than bitmap/raster versions -vector_maps_install: True -vector_maps_enabled: True +osm_vector_maps_install: True +osm_vector_maps_enabled: True # Might stall MongoDB on Power Failure: github.com/xsce/xsce/issues/879 # Sugarizer 1.0.1+ strategies to solve? github.com/iiab/iiab/pull/957 From 612032da31991e28a3015004f83e45049546f79a Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 6 May 2019 07:29:44 -0700 Subject: [PATCH 2/4] change directory name --- roles/{vector-maps => osm-vector-maps}/defaults/main.yml | 0 roles/{vector-maps => osm-vector-maps}/files/countries.json | 0 roles/{vector-maps => osm-vector-maps}/files/en-map_test.json | 0 roles/{vector-maps => osm-vector-maps}/files/map_functions.js | 0 roles/{vector-maps => osm-vector-maps}/files/test-index.redirect | 0 roles/{vector-maps => osm-vector-maps}/tasks/main.yml | 0 roles/{vector-maps => osm-vector-maps}/templates/iiab-update-map | 0 roles/{vector-maps => osm-vector-maps}/templates/index.html | 0 roles/{vector-maps => osm-vector-maps}/templates/main.js | 0 roles/{vector-maps => osm-vector-maps}/templates/vector-maps.conf | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename roles/{vector-maps => osm-vector-maps}/defaults/main.yml (100%) rename roles/{vector-maps => osm-vector-maps}/files/countries.json (100%) rename roles/{vector-maps => osm-vector-maps}/files/en-map_test.json (100%) rename roles/{vector-maps => osm-vector-maps}/files/map_functions.js (100%) rename roles/{vector-maps => osm-vector-maps}/files/test-index.redirect (100%) rename roles/{vector-maps => osm-vector-maps}/tasks/main.yml (100%) rename roles/{vector-maps => osm-vector-maps}/templates/iiab-update-map (100%) rename roles/{vector-maps => osm-vector-maps}/templates/index.html (100%) rename roles/{vector-maps => osm-vector-maps}/templates/main.js (100%) rename roles/{vector-maps => osm-vector-maps}/templates/vector-maps.conf (100%) diff --git a/roles/vector-maps/defaults/main.yml b/roles/osm-vector-maps/defaults/main.yml similarity index 100% rename from roles/vector-maps/defaults/main.yml rename to roles/osm-vector-maps/defaults/main.yml diff --git a/roles/vector-maps/files/countries.json b/roles/osm-vector-maps/files/countries.json similarity index 100% rename from roles/vector-maps/files/countries.json rename to roles/osm-vector-maps/files/countries.json diff --git a/roles/vector-maps/files/en-map_test.json b/roles/osm-vector-maps/files/en-map_test.json similarity index 100% rename from roles/vector-maps/files/en-map_test.json rename to roles/osm-vector-maps/files/en-map_test.json diff --git a/roles/vector-maps/files/map_functions.js b/roles/osm-vector-maps/files/map_functions.js similarity index 100% rename from roles/vector-maps/files/map_functions.js rename to roles/osm-vector-maps/files/map_functions.js diff --git a/roles/vector-maps/files/test-index.redirect b/roles/osm-vector-maps/files/test-index.redirect similarity index 100% rename from roles/vector-maps/files/test-index.redirect rename to roles/osm-vector-maps/files/test-index.redirect diff --git a/roles/vector-maps/tasks/main.yml b/roles/osm-vector-maps/tasks/main.yml similarity index 100% rename from roles/vector-maps/tasks/main.yml rename to roles/osm-vector-maps/tasks/main.yml diff --git a/roles/vector-maps/templates/iiab-update-map b/roles/osm-vector-maps/templates/iiab-update-map similarity index 100% rename from roles/vector-maps/templates/iiab-update-map rename to roles/osm-vector-maps/templates/iiab-update-map diff --git a/roles/vector-maps/templates/index.html b/roles/osm-vector-maps/templates/index.html similarity index 100% rename from roles/vector-maps/templates/index.html rename to roles/osm-vector-maps/templates/index.html diff --git a/roles/vector-maps/templates/main.js b/roles/osm-vector-maps/templates/main.js similarity index 100% rename from roles/vector-maps/templates/main.js rename to roles/osm-vector-maps/templates/main.js diff --git a/roles/vector-maps/templates/vector-maps.conf b/roles/osm-vector-maps/templates/vector-maps.conf similarity index 100% rename from roles/vector-maps/templates/vector-maps.conf rename to roles/osm-vector-maps/templates/vector-maps.conf From 84220ddbb717aa1f10a64b1a40c025f2d03ec99d Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 6 May 2019 07:32:09 -0700 Subject: [PATCH 3/4] apache conf file --- .../templates/{vector-maps.conf => osm-vector-maps.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename roles/osm-vector-maps/templates/{vector-maps.conf => osm-vector-maps.conf} (100%) diff --git a/roles/osm-vector-maps/templates/vector-maps.conf b/roles/osm-vector-maps/templates/osm-vector-maps.conf similarity index 100% rename from roles/osm-vector-maps/templates/vector-maps.conf rename to roles/osm-vector-maps/templates/osm-vector-maps.conf From c90da038daab8a377580e8784cddae0e9b2b1761 Mon Sep 17 00:00:00 2001 From: George Hunt Date: Mon, 6 May 2019 12:22:57 -0700 Subject: [PATCH 4/4] buster patch in local_facts --- scripts/local_facts.fact | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/local_facts.fact b/scripts/local_facts.fact index 40d6bec1d..ce3dcce09 100755 --- a/scripts/local_facts.fact +++ b/scripts/local_facts.fact @@ -14,7 +14,12 @@ OS=${OS//\"/} VERSION_ID=`grep VERSION_ID /etc/*elease | cut -d= -f2` VERSION_ID=${VERSION_ID//\"/} VERSION_ID=${VERSION_ID%%.*} -OS_VER=$OS-$VERSION_ID +grep PRETTY_NAME /etc/*ease|grep buster +if [ $? -eq 0 ];then + OS_VER=debian-10 +else + OS_VER=$OS-$VERSION_ID +fi DHCPCD_PATH=`which dhcpcd` NM_PATH=`which NetworkManager`