mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #14930 from whiteinge/doc-event-fire_master_env-sudo
Update event.fire_master_env docstring with sudo instructions
This commit is contained in:
commit
2aa208f636
1 changed files with 15 additions and 0 deletions
|
@ -109,6 +109,21 @@ def fire_master_env(tag, data=None, preload=None):
|
|||
|
||||
salt-call event.fire_master_env myco/jenkins/build/success
|
||||
|
||||
A convenient way to allow Jenkins to execute ``salt-call`` is via sudo. The
|
||||
following rule in sudoers will allow the ``jenkins`` user to run only the
|
||||
following command.
|
||||
|
||||
``/etc/sudoers`` (allow preserving the environment):
|
||||
|
||||
.. code-block:: text
|
||||
|
||||
jenkins ALL=(ALL) NOPASSWD:SETENV: /usr/bin/salt-call event.fire_master_env*
|
||||
|
||||
Call Jenkins via sudo (preserve the environment):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo -E salt-call event.fire_master_env myco/jenkins/build/success
|
||||
'''
|
||||
env_dict = {}
|
||||
env_dict.update(os.environ)
|
||||
|
|
Loading…
Add table
Reference in a new issue