ssh_ext_alternatives.rst 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. .. _ssh-ext-alternatives:
  2. ====================
  3. SSH Ext Alternatives
  4. ====================
  5. In the 2019.2.0 release the ``ssh_ext_alternatives`` feature was added.
  6. This allows salt-ssh to work across different python versions. You will
  7. need to ensure you have the following:
  8. - Salt is installed, with all required dependnecies for both Python2 and Python3
  9. - Everything needs to be importable from the respective Python environment.
  10. To enable using this feature you will need to edit the master configuration similar
  11. to below:
  12. .. code-block:: yaml
  13. ssh_ext_alternatives:
  14. 2019.2: # Namespace, can be anything.
  15. py-version: [2, 7] # Constraint to specific interpreter version
  16. path: /opt/2019.2/salt # Main Salt installation directory.
  17. dependencies: # List of dependencies and their installation paths
  18. jinja2: /opt/jinja2
  19. yaml: /opt/yaml
  20. tornado: /opt/tornado
  21. msgpack: /opt/msgpack
  22. certifi: /opt/certifi
  23. singledispatch: /opt/singledispatch.py
  24. singledispatch_helpers: /opt/singledispatch_helpers.py
  25. markupsafe: /opt/markupsafe
  26. backports_abc: /opt/backports_abc.py
  27. auto_detect
  28. -----------
  29. In the 3001 release the ``auto_detect`` feature was added for ``ssh_ext_alternatives``.
  30. This allows salt-ssh to automatically detect the path to all of your dependencies and
  31. does not require you to define them under ``dependencies``.
  32. .. code-block:: yaml
  33. ssh_ext_alternatives:
  34. 2019.2: # Namespace, can be anything.
  35. py-version: [2, 7] # Constraint to specific interpreter version
  36. path: /opt/2019.2/salt # Main Salt installation directory.
  37. auto_detect: True # Auto detect dependencies
  38. py_bin: /usr/bin/python2.7 # Python binary path used to auto detect dependencies
  39. If ``py_bin`` is not set alongside ``auto_detect``, it will attempt to auto detect
  40. the dependnecies using the major version set in ``py-version``. For example if you
  41. have ``[2, 7]`` set as your ``py-version``, it will attempt to use the binary ``python2``.
  42. You can also use ``auto_detect`` and ``dependencies`` together.
  43. .. code-block:: yaml
  44. ssh_ext_alternatives:
  45. 2019.2: # Namespace, can be anything.
  46. py-version: [2, 7] # Constraint to specific interpreter version
  47. path: /opt/2019.2/salt # Main Salt installation directory.
  48. auto_detect: True # Auto detect dependencies
  49. py_bin: /usr/bin/python2.7 # Python binary path to auto detect dependencies
  50. dependencies: # List of dependencies and their installation paths
  51. jinja2: /opt/jinja2
  52. If a dependency is defined in the ``dependecies`` list ``ssh_ext_alternatives`` will use
  53. this dependency, instead of the path that ``auto_detect`` finds. For example, if you define
  54. ``/opt/jinja2`` under your ``dependencies`` for jinja2, it will not try to autodetect the
  55. file path to the jinja2 module, and will favor ``/opt/jinja2``.