22.27.28. salt.states.environ

Support for getting and setting the environment variables of the current salt process.

salt.states.environ.setenv(name, value, false_unsets=False, clear_all=False, update_minion=False)

Set the salt process environment variables.

name
The environment key to set. Must be a string.
value
Either a string or dict. When string, it will be the value set for the environment key of 'name' above. When a dict, each key/value pair represents an environment variable to set.
false_unsets
If a key's value is False and false_unsets is True, then the key will be removed from the salt processes environment dict entirely. If a key's value is False and false_unsets is not True, then the key's value will be set to an empty string. Default: False
clear_all
USE WITH CAUTION! This option can unset environment variables needed for salt to function properly. If clear_all is True, then any environment variables not defined in the environ dict will be deleted. Default: False
update_minion
If True, apply these environ changes to the main salt-minion process. If False, the environ changes will only affect the current salt subprocess. Default: False

CLI Example:

a_string_env:
   environ.set:
     - name: foo
     - value: bar
     - update_minion: True

a_dict_env:
   environ.set:
     - name: does_not_matter
     - value:
         foo: bar
         baz: quux

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.1.13

Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.

Previous topic

22.27.27. salt.states.dockerio

Next topic

22.27.29. salt.states.eselect

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.