Sudo executor module
@author: Dmitry Kuzmenko <dmitry.kuzmenko@dsr-company.com>
salt.executors.sudo.
SudoExecutor
(opts, data, func, args, kwargs)¶Allow for the calling of execution modules via sudo.
This module is invoked by the minion if the sudo_user
minion config is
present.
Example minion config:
sudo_user: saltdev
Once this setting is made, any execution module call done by the minion will be
run under sudo -u <sudo_user> salt-call
. For example, with the above
minion config,
salt sudo_minion cmd.run 'cat /etc/sudoers'
is equivalent to
sudo -u saltdev salt-call cmd.run 'cat /etc/sudoers'
being run on sudo_minion
.
execute
()¶Wrap a shell execution out to salt call with sudo
Example:
/etc/salt/minion
sudo_user: saltdev
salt '*' test.ping # is run as saltdev user
salt.executors.sudo.
get
(*args, **kwargs)¶