salt.rst 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. .. _ref-cli-salt:
  2. ========
  3. ``salt``
  4. ========
  5. Synopsis
  6. ========
  7. salt '*' [ options ] sys.doc
  8. salt -E '.*' [ options ] sys.doc cmd
  9. salt -G 'os:Arch.*' [ options ] test.version
  10. salt -C 'G@os:Arch.* and webserv* or G@kernel:FreeBSD' [ options ] test.version
  11. Description
  12. ===========
  13. Salt allows for commands to be executed across a swath of remote systems in
  14. parallel. This means that remote systems can be both controlled and queried
  15. with ease.
  16. Options
  17. =======
  18. .. program:: salt
  19. .. include:: _includes/common-options.rst
  20. .. include:: _includes/timeout-option.rst
  21. .. |timeout| replace:: 5
  22. .. option:: -s, --static
  23. By default as of version 0.9.8 the salt command returns data to the
  24. console as it is received from minions, but previous releases would return
  25. data only after all data was received. Use the static option to only return
  26. the data with a hard timeout and after all minions have returned.
  27. Without the static option, you will get a separate JSON string per minion
  28. which makes JSON output invalid as a whole.
  29. .. option:: --async
  30. Instead of waiting for the job to run on minions only print the job id of
  31. the started execution and complete.
  32. .. option:: --subset=SUBSET
  33. Execute the routine on a random subset of the targeted minions. The
  34. minions will be verified that they have the named function before
  35. executing. The SUBSET argument is the count of the minions to target.
  36. .. option:: -v VERBOSE, --verbose
  37. Turn on verbosity for the salt call, this will cause the salt command to
  38. print out extra data like the job id.
  39. .. option:: --hide-timeout
  40. Instead of showing the return data for all minions. This option
  41. prints only the online minions which could be reached.
  42. .. option:: -b BATCH, --batch-size=BATCH
  43. Instead of executing on all targeted minions at once, execute on a
  44. progressive set of minions. This option takes an argument in the form of
  45. an explicit number of minions to execute at once, or a percentage of
  46. minions to execute on.
  47. .. option:: -a EAUTH, --auth=EAUTH
  48. Pass in an external authentication medium to validate against. The
  49. credentials will be prompted for. The options are `auto`,
  50. `keystone`, `ldap`, and `pam`. Can be used with the -T
  51. option.
  52. .. option:: -T, --make-token
  53. Used in conjunction with the -a option. This creates a token that allows
  54. for the authenticated user to send commands without needing to
  55. re-authenticate.
  56. .. option:: --return=RETURNER
  57. Choose an alternative returner to call on the minion, if an
  58. alternative returner is used then the return will not come back to
  59. the command line but will be sent to the specified return system.
  60. The options are `carbon`, `cassandra`, `couchbase`, `couchdb`,
  61. `elasticsearch`, `etcd`, `hipchat`, `local`, `local_cache`,
  62. `memcache`, `mongo`, `mysql`, `odbc`, `postgres`, `redis`,
  63. `sentry`, `slack`, `sms`, `smtp`, `sqlite3`, `syslog`, and `xmpp`.
  64. .. option:: -d, --doc, --documentation
  65. Return the documentation for the module functions available on the minions
  66. .. option:: --args-separator=ARGS_SEPARATOR
  67. Set the special argument used as a delimiter between command arguments of
  68. compound commands. This is useful when one wants to pass commas as
  69. arguments to some of the commands in a compound command.
  70. .. include:: _includes/logging-options.rst
  71. .. |logfile| replace:: /var/log/salt/master
  72. .. |loglevel| replace:: ``warning``
  73. .. include:: _includes/target-selection.rst
  74. .. include:: _includes/extended-target-selection.rst
  75. .. include:: _includes/output-options.rst
  76. .. note::
  77. If using ``--out=json``, you will probably want ``--static`` as well.
  78. Without the static option, you will get a separate JSON string per minion
  79. which makes JSON output invalid as a whole.
  80. This is due to using an iterative outputter. So if you want to feed it
  81. to a JSON parser, use ``--static`` as well.
  82. See also
  83. ========
  84. :manpage:`salt(7)`
  85. :manpage:`salt-master(1)`
  86. :manpage:`salt-minion(1)`