%PDF- %PDF-
Direktori : /lib/python2.7/site-packages/salt/sdb/ |
Current File : //lib/python2.7/site-packages/salt/sdb/vault.pyc |
� ���^c @@ sr d Z d d l m Z m Z m Z d d l Z d d l Z e j e � Z i d d 6Z d d � Z d d � Z d S( uQ Vault SDB Module :maintainer: SaltStack :maturity: New :platform: all .. versionadded:: 2016.11.0 This module allows access to Hashicorp Vault using an ``sdb://`` URI. Base configuration instructions are documented in the execution module docs. Below are noted extra configuration required for the sdb module, but the base configuration must also be completed. Like all sdb modules, the vault module requires a configuration profile to be configured in either the minion configuration file or a pillar. This profile requires only setting the ``driver`` parameter to ``vault``: .. code-block:: yaml myvault: driver: vault Once configured you can access data using a URL such as: .. code-block:: yaml password: sdb://myvault/secret/passwords/mypassword In this URL, ``myvault`` refers to the configuration profile, ``secret/passwords`` is the path where the data resides, and ``mypassword`` is the key of the data to return. The above URI is analogous to running the following vault command: .. code-block:: bash $ vault read -field=mypassword secret/passwords i ( t absolute_importt print_functiont unicode_literalsNu setu set_c C@ s� d | k r5 t d d d � | j d � \ } } n | j d d � \ } } y\ d j | � } i | | 6} t d d | | d | �} | j d k r� | j � n t SWnA t k r� } t j d t | � j | � t j j | � � n Xd S( u3 Set a key/value pair in the vault service u ?u versions.warn_untilu Neonu� Using ? to seperate between the path and key for vault has been deprecated and will be removed in {version}. Please just use a /.u /i u v1/{0}u vault.make_requestu POSTt jsoni� u Failed to write secret! %s: %sN( t __utils__t splitt rsplitt formatt status_codet raise_for_statust Truet Exceptiont logt errort typet __name__t saltt exceptionst CommandExecutionError( t keyt valuet profilet patht urlt datat responset e( ( s2 /usr/lib/python2.7/site-packages/salt/sdb/vault.pyt set_7 s( c C@ s� d | k r5 t d d d � | j d � \ } } n | j d d � \ } } y] d j | � } t d d | | � } | j d k r� | j � n | j � d } | | SWnA t k r� } t j d t | � j | � t j j | � � n Xd S( u, Get a value from the vault service u ?u versions.warn_untilu Neonu� Using ? to seperate between the path and key for vault has been deprecated and will be removed in {version}. Please just use a /.u /i u v1/{0}u vault.make_requestu GETi� u datau Failed to read secret! %s: %sN( R R R R R R R R R R R R R R R ( R R R R R R R ( ( s2 /usr/lib/python2.7/site-packages/salt/sdb/vault.pyt getX s ( t __doc__t __future__R R R t loggingt salt.exceptionsR t getLoggerR R t __func_alias__t NoneR R ( ( ( s2 /usr/lib/python2.7/site-packages/salt/sdb/vault.pyt <module>) s !