%PDF- %PDF-
| Direktori : /proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/sdb/ |
| Current File : //proc/self/root/proc/thread-self/root/usr/lib/python2.7/site-packages/salt/sdb/env.pyc |
�
���^c @@ s` d Z d d l m Z m Z m Z d d l Z i d d 6Z d � Z d d � Z d d � Z
d S( u�
Environment sdb Module
:maintainer: SaltStack
:maturity: New
:depends: None
:platform: all
This module allows access to environment variables using an ``sdb://`` URI.
Example configuration for this module:
.. code-block:: yaml
osenv:
driver: env
WARNING:
--------
OS environment variables will be available
to read via SDB.
Please make sure you don't have any sensitive data
in your environment variables!!
Example usage of sdb env module:
.. code-block:: jinja
set some env var:
cmd.run:
- name: echo {{ salt['sdb.set']('sdb://osenv/foo', 'bar') }}
- order: 1
{% if salt['sdb.get']('sdb://osenv/foo') == 'bar' %}
always-changes-and-succeeds:
test.succeed_with_changes:
- name: foo
{% else %}
always-changes-and-fails:
test.fail_with_changes:
- name: foo
{% endif %}
The above example will return success.
The ``env`` sdb module can also be used with salt cloud.
Assuming you have exported the environment variable named
``compute`` (and have ``osenv`` defined).
The example below will look for the salt cloud config key ``compute_name``
in the environment:
.. code-block:: yaml
my-openstack-config:
compute_name: sdb://osenv/compute
..snip
i ( t absolute_importt print_functiont unicode_literalsNu setu set_c C@ s t S( u
Always load
( t True( ( ( s0 /usr/lib/python2.7/site-packages/salt/sdb/env.pyt __virtual__F s c C@ s t j j | | � S( u
Set a key/value pair
( t ost environt
setdefault( t keyt valuet profile( ( s0 /usr/lib/python2.7/site-packages/salt/sdb/env.pyt set_M s c C@ s t j j | � S( u
Get a value
( R R t get( R R
( ( s0 /usr/lib/python2.7/site-packages/salt/sdb/env.pyR U s ( t __doc__t
__future__R R R R t __func_alias__R t NoneR R ( ( ( s0 /usr/lib/python2.7/site-packages/salt/sdb/env.pyt <module>; s