Support for getting and setting the environment variables of the current salt process.
salt.modules.environ.
get
(key, default='')¶Get a single salt process environment variable.
CLI Example:
salt '*' environ.get foo
salt '*' environ.get baz default=False
salt.modules.environ.
has_value
(key, value=None)¶Determine whether the key exists in the current salt process environment dictionary. Optionally compare the current value of the environment against the supplied value string.
CLI Example:
salt '*' environ.has_value foo
salt.modules.environ.
item
(keys, default='')¶Get one or more salt process environment variables. Returns a dict.
CLI Example:
salt '*' environ.item foo
salt '*' environ.item '[foo, baz]' default=None
salt.modules.environ.
items
()¶Return a dict of the entire environment set for the salt process
CLI Example:
salt '*' environ.items
salt.modules.environ.
setenv
(environ, false_unsets=False, clear_all=False, update_minion=False)¶Set multiple salt process environment variables from a dict. Returns a dict.
CLI Example:
salt '*' environ.setenv '{"foo": "bar", "baz": "quux"}'
salt '*' environ.setenv '{"a": "b", "c": False}' false_unsets=True
salt.modules.environ.
setval
(key, val, false_unsets=False)¶Set a single salt process environment variable. Returns True on success.
CLI Example:
salt '*' environ.setval foo bar
salt '*' environ.setval baz val=False false_unsets=True