2016-02-01 03:10:02 +00:00
|
|
|
.. _ssh-roster:
|
|
|
|
|
2013-09-09 05:00:45 +00:00
|
|
|
============
|
|
|
|
Salt Rosters
|
|
|
|
============
|
|
|
|
|
2014-04-30 20:55:30 +00:00
|
|
|
Salt rosters are pluggable systems added in Salt 0.17.0 to facilitate the
|
2013-09-09 05:00:45 +00:00
|
|
|
``salt-ssh`` system.
|
|
|
|
The roster system was created because ``salt-ssh`` needs a means to
|
2013-09-20 12:01:20 +00:00
|
|
|
identify which systems need to be targeted for execution.
|
2013-09-09 05:00:45 +00:00
|
|
|
|
2014-06-30 19:47:52 +00:00
|
|
|
.. seealso:: :ref:`all-salt.roster`
|
|
|
|
|
2013-09-09 05:00:45 +00:00
|
|
|
.. note::
|
|
|
|
The Roster System is not needed or used in standard Salt because the
|
|
|
|
master does not need to be initially aware of target systems, since the
|
|
|
|
Salt Minion checks itself into the master.
|
|
|
|
|
|
|
|
Since the roster system is pluggable, it can be easily augmented to attach to
|
|
|
|
any existing systems to gather information about what servers are presently
|
2013-09-29 05:16:13 +00:00
|
|
|
available and should be attached to by ``salt-ssh``. By default the roster
|
|
|
|
file is located at /etc/salt/roster.
|
2013-09-09 05:00:45 +00:00
|
|
|
|
|
|
|
How Rosters Work
|
|
|
|
================
|
|
|
|
|
2014-01-27 02:38:03 +00:00
|
|
|
The roster system compiles a data structure internally referred to as
|
2015-10-05 23:37:13 +00:00
|
|
|
``targets``. The ``targets`` is a list of target systems and attributes about how
|
2013-09-09 05:00:45 +00:00
|
|
|
to connect to said systems. The only requirement for a roster module in Salt
|
2015-10-05 23:37:13 +00:00
|
|
|
is to return the ``targets`` data structure.
|
2013-09-09 05:00:45 +00:00
|
|
|
|
|
|
|
Targets Data
|
|
|
|
------------
|
|
|
|
|
2015-10-05 23:37:13 +00:00
|
|
|
The information which can be stored in a roster ``target`` is the following:
|
2013-09-09 05:00:45 +00:00
|
|
|
|
|
|
|
.. code-block:: yaml
|
|
|
|
|
2015-05-04 20:46:16 +00:00
|
|
|
<Salt ID>: # The id to reference the target system with
|
|
|
|
host: # The IP address or DNS name of the remote host
|
|
|
|
user: # The user to log in as
|
|
|
|
passwd: # The password to log in with
|
2013-10-11 14:21:52 +00:00
|
|
|
|
|
|
|
# Optional parameters
|
2015-05-04 20:46:16 +00:00
|
|
|
port: # The target system's ssh port number
|
|
|
|
sudo: # Boolean to run command via sudo
|
2016-08-04 18:24:18 +00:00
|
|
|
sudo_user: # Str: Set this to execute Salt as a sudo user other than root.
|
|
|
|
# This user must be in the same system group as the remote user
|
2016-08-04 18:41:36 +00:00
|
|
|
# that is used to login and is specified above. Alternatively,
|
|
|
|
# the user must be a super-user.
|
2015-09-24 22:25:22 +00:00
|
|
|
tty: # Boolean: Set this option to True if sudo is also set to
|
|
|
|
# True and requiretty is also set on the target system
|
2015-05-04 20:46:16 +00:00
|
|
|
priv: # File path to ssh private key, defaults to salt-ssh.rsa
|
2016-02-18 20:14:47 +00:00
|
|
|
# The priv can also be set to agent-forwarding to not specify
|
|
|
|
# a key, but use ssh agent forwarding
|
2015-05-05 22:26:39 +00:00
|
|
|
timeout: # Number of seconds to wait for response when establishing
|
|
|
|
# an SSH connection
|
2015-05-04 20:46:16 +00:00
|
|
|
minion_opts: # Dictionary of minion opts
|
2015-05-06 21:49:50 +00:00
|
|
|
thin_dir: # The target system's storage directory for Salt
|
|
|
|
# components. Defaults to /tmp/salt-<hash>.
|
2015-12-10 21:51:43 +00:00
|
|
|
cmd_umask: # umask to enforce for the salt-call command. Should be in
|
|
|
|
# octal (so for 0o077 in YAML you would do 0077, or 63)
|
2015-01-12 00:54:30 +00:00
|
|
|
|
|
|
|
thin_dir
|
|
|
|
--------
|
|
|
|
|
|
|
|
Salt needs to upload a standalone environment to the target system, and this
|
2015-05-06 21:49:50 +00:00
|
|
|
defaults to /tmp/salt-<hash>. This directory will be cleaned up per normal
|
2015-01-12 00:54:30 +00:00
|
|
|
systems operation.
|
|
|
|
|
|
|
|
If you need a persistent Salt environment, for instance to set persistent grains,
|
|
|
|
this value will need to be changed.
|