1
0

salt-ssh.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. ============
  2. ``salt-ssh``
  3. ============
  4. Synopsis
  5. ========
  6. .. code-block:: bash
  7. salt-ssh '*' [ options ] sys.doc
  8. salt-ssh -E '.*' [ options ] sys.doc cmd
  9. Description
  10. ===========
  11. Salt SSH allows for salt routines to be executed using only SSH for transport
  12. Options
  13. =======
  14. .. program:: salt-ssh
  15. .. include:: _includes/common-options.rst
  16. .. option:: --hard-crash
  17. Raise any original exception rather than exiting gracefully. Default: False.
  18. .. option:: -r, --raw, --raw-shell
  19. Execute a raw shell command.
  20. .. option:: --roster
  21. Define which roster system to use, this defines if a database backend,
  22. scanner, or custom roster system is used. Default is the flat file roster.
  23. .. option:: --roster-file
  24. Define an alternative location for the default roster file location. The
  25. default roster file is called ``roster`` and is found in the same directory
  26. as the master config file.
  27. .. versionadded:: 2014.1.0
  28. .. option:: --refresh, --refresh-cache
  29. Force a refresh of the master side data cache of the target's data. This
  30. is needed if a target's grains have been changed and the auto refresh
  31. timeframe has not been reached.
  32. .. option:: --max-procs
  33. Set the number of concurrent minions to communicate with. This value
  34. defines how many processes are opened up at a time to manage connections,
  35. the more running process the faster communication should be, default
  36. is 25.
  37. .. option:: --extra-filerefs=EXTRA_FILEREFS
  38. Pass in extra files to include in the state tarball.
  39. .. option:: --min-extra-modules=MIN_EXTRA_MODS
  40. One or comma-separated list of extra Python modulesto be included
  41. into Minimal Salt.
  42. .. option:: --thin-extra-modules=THIN_EXTRA_MODS
  43. One or comma-separated list of extra Python modulesto be included
  44. into Thin Salt.
  45. .. option:: -v, --verbose
  46. Turn on command verbosity, display jid.
  47. .. option:: -s, --static
  48. Return the data from minions as a group after they all return.
  49. .. option:: -w, --wipe
  50. Remove the deployment of the salt files when done executing.
  51. .. option:: -W, --rand-thin-dir
  52. Select a random temp dir to deploy on the remote system. The dir
  53. will be cleaned after the execution.
  54. .. option:: -t, --regen-thin, --thin
  55. Trigger a thin tarball regeneration. This is needed if custom
  56. grains/modules/states have been added or updated.
  57. .. option:: --python2-bin=PYTHON2_BIN
  58. Path to a python2 binary which has salt installed.
  59. .. option:: --python3-bin=PYTHON3_BIN
  60. Path to a python3 binary which has salt installed.
  61. .. option:: --jid=JID
  62. Pass a JID to be used instead of generating one.
  63. .. option:: --pre-flight
  64. Run the ssh_pre_flight script defined in the roster.
  65. By default this script will only run if the thin dir
  66. does not exist on the target minion. This option will
  67. force the script to run regardless of the thin dir
  68. existing or not.
  69. Authentication Options
  70. ----------------------
  71. .. option:: --priv=SSH_PRIV
  72. Specify the SSH private key file to be used for authentication.
  73. .. option:: --priv-passwd=SSH_PRIV_PASSWD
  74. Specify the SSH private key file's passphrase if need be.
  75. .. option:: -i, --ignore-host-keys
  76. By default ssh host keys are honored and connections will ask for
  77. approval. Use this option to disable StrictHostKeyChecking.
  78. .. option:: --no-host-keys
  79. Fully ignores ssh host keys which by default are honored and connections
  80. would ask for approval. Useful if the host key of a remote server has
  81. changed and would still error with --ignore-host-keys.
  82. .. option:: --user=SSH_USER
  83. Set the default user to attempt to use when authenticating.
  84. .. option:: --passwd
  85. Set the default password to attempt to use when authenticating.
  86. .. option:: --askpass
  87. Interactively ask for the SSH password with no echo - avoids password
  88. in process args and stored in history.
  89. .. option:: --key-deploy
  90. Set this flag to attempt to deploy the authorized ssh key with all
  91. minions. This combined with --passwd can make initial deployment of keys
  92. very fast and easy.
  93. .. option:: --identities-only
  94. Use the only authentication identity files configured in the ssh_config
  95. files. See IdentitiesOnly flag in man ssh_config.
  96. .. option:: --sudo
  97. Run command via sudo.
  98. Scan Roster Options
  99. -------------------
  100. .. option:: --scan-ports=SSH_SCAN_PORTS
  101. Comma-separated list of ports to scan in the scan roster.
  102. .. option:: --scan-timeout=SSH_SCAN_TIMEOUT
  103. Scanning socket timeout for the scan roster.
  104. .. include:: _includes/logging-options.rst
  105. .. |logfile| replace:: /var/log/salt/ssh
  106. .. |loglevel| replace:: ``warning``
  107. .. include:: _includes/target-selection-ssh.rst
  108. .. include:: _includes/output-options.rst
  109. .. note::
  110. If using ``--out=json``, you will probably want ``--static`` as well.
  111. Without the static option, you will get a separate JSON string per minion
  112. which makes JSON output invalid as a whole.
  113. This is due to using an iterative outputter. So if you want to feed it
  114. to a JSON parser, use ``--static`` as well.
  115. See also
  116. ========
  117. :manpage:`salt(7)`
  118. :manpage:`salt-master(1)`
  119. :manpage:`salt-minion(1)`