Set up GIS software on multiple computers (Windows & Linux) simultaneosly using SaltStack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
3.7 KiB

6 years ago
  1. {% set qgis_version = '2.18' %}
  2. {% set os_version = 'windows' %}
  3. {#
  4. # Things to be considered: https://docs.saltstack.com/en/latest/ref/states/parallel.html
  5. #}
  6. {#
  7. # LASTools: Works OK
  8. #}
  9. {% for file in [
  10. 'las2las',
  11. 'las2txt',
  12. 'lasdiff',
  13. 'lasindex',
  14. 'lasinfo',
  15. 'lasmerge',
  16. 'lasprecision',
  17. 'laszip',
  18. 'txt2las',
  19. 'blast2dem',
  20. 'blast2iso',
  21. 'bytecopy',
  22. 'bytediff',
  23. 'e572las',
  24. 'las2dem',
  25. 'las2iso',
  26. 'las2shp',
  27. 'las2tin',
  28. 'lasboundary',
  29. 'lascanopy',
  30. 'lasclassify',
  31. 'lasclip',
  32. 'lascolor',
  33. 'lascontrol',
  34. 'lascopy',
  35. 'lasduplicate',
  36. 'lasgrid',
  37. 'lasground',
  38. 'lasground_new',
  39. 'lasheight',
  40. 'laslayers',
  41. 'lasnoise',
  42. 'lasoptimize',
  43. 'lasoverage',
  44. 'lasoverlap',
  45. 'lasplanes',
  46. 'laspublish',
  47. 'lasreturn',
  48. 'lassort',
  49. 'lassplit',
  50. 'lasthin',
  51. 'lastile',
  52. 'lastool',
  53. 'lastrack',
  54. 'lasvalidate',
  55. 'lasview',
  56. 'lasvoxel',
  57. 'shp2las',
  58. 'sonarnoiseblaster'
  59. ]
  60. %}
  61. {{ file }}:
  62. file.managed:
  63. - makedirs: True
  64. - name: 'C:\lastools\{{ file }}.exe'
  65. - source: 'salt://gis_{{ os_version }}/files/lastools/{{ file }}.exe'
  66. {% endfor %}
  67. {#
  68. # GPX2SHP: Works OK
  69. #}
  70. put_gpx2shp.exe:
  71. file.managed:
  72. - name: 'C:\lastools\gpx2shp.exe'
  73. - source: 'salt://gis_{{ os_version }}/files/gpx2shp.exe'
  74. {#
  75. # Installation of Windows programs with Salt is not as good as on Linux minions
  76. # Many installation processes seem not to report about their statuses back to the
  77. # Salt minion process, thus making Salt master to think that the minion
  78. # computer doesn't return anything. Therefore, some custom approaches
  79. # for installing Windows software on Salt minion must be taken for now
  80. #}
  81. {#
  82. # QuickRoute: installs OK - NOTE: retcode 2 (Error), install_status: success
  83. #}
  84. install_quickroute:
  85. pkg.installed:
  86. - pkgs:
  87. - quickroute-gps_x86
  88. {#
  89. # Merkaartor: Installs OK - NOTE: retcode 2 (Error), install_status: success
  90. #}
  91. install_merkaartor:
  92. pkg.installed:
  93. - pkgs:
  94. - merkaartor
  95. {#
  96. # CloudCompare: Installs OK although takes time
  97. #}
  98. install_cloudcompare:
  99. pkg.installed:
  100. - pkgs:
  101. - cloudcompare
  102. {#
  103. # GPSd: Silent installer complaints about missing serial port, thus hanging the Salt state execution
  104. # Disable the package installation until solution is found
  105. #install_gpsd:
  106. # pkg.installed:
  107. # - pkgs:
  108. # - gpsd
  109. # QGIS: Installs OK although takes A LOT OF time
  110. # Requires increased timeout in salt command on Salt master computer
  111. # until better support for NSIS installers have been implemented in Saltstack
  112. #
  113. # See runme.sh for further information
  114. # The installer does not work as well as CloudCompare's installer
  115. # This is not a good workaround but better than nothing
  116. # Without it, the state hangs here forever until timeout is reached when
  117. # re-running the installation:
  118. #}
  119. {% if not salt['file.directory_exists']('C:\Program Files\QGIS ' + qgis_version) %}
  120. install_qgis_pkg:
  121. pkg.installed:
  122. - pkgs:
  123. - qgis
  124. {% endif %}
  125. {#
  126. # At launch, QGIS tends to complaint about SSL. Fix this by doing the following.
  127. #}
  128. fix_qgis_ssl:
  129. cmd.run:
  130. - shell: powershell
  131. - name: '(New-Object System.Net.WebClient).DownloadString("https://ubuntu.qgis.org/version.txt")'
  132. qgis_lastools:
  133. file.managed:
  134. - name: C:\Program Files\QGIS {{ qgis_version }}\apps\qgis-ltr\python\plugins\processing\algs\lidar\LidarToolsAlgorithmProvider.py
  135. - source: salt://common/qgis_lastools/LidarToolsAlgorithmProvider.py
  136. {#
  137. # Technically the following should be required, but qgis installation status retcode is always 2 (failure) although
  138. # returned string states: 'install_status: success' and installation can be confirmed on the minion computer
  139. # This is likely a bug in Saltstack because it happens on multiple Windows NSIS installer packages
  140. # - require:
  141. # - pkg: install_qgis_pkg
  142. #}