%PDF- %PDF-
| Direktori : /lib/python2.7/site-packages/salt/renderers/ |
| Current File : //lib/python2.7/site-packages/salt/renderers/pass.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l Z d d l m Z d d l m
Z
m Z d d l Z
d d l m Z d d l m Z e j e � Z d � Z d � Z d
� Z d d d d
� Z d S( u
Pass Renderer for Salt
======================
pass_ is an encrypted on-disk password store.
.. _pass: https://www.passwordstore.org/
.. versionadded:: 2017.7.0
Setup
-----
*Note*: ``<user>`` needs to be replaced with the user salt-master will be
running as.
Have private gpg loaded into ``user``'s gpg keyring
.. code-block:: yaml
load_private_gpg_key:
cmd.run:
- name: gpg --import <location_of_private_gpg_key>
- unless: gpg --list-keys '<gpg_name>'
Said private key's public key should have been used when encrypting pass entries
that are of interest for pillar data.
Fetch and keep local pass git repo up-to-date
.. code-block:: yaml
update_pass:
git.latest:
- force_reset: True
- name: <git_repo>
- target: /<user>/.password-store
- identity: <location_of_ssh_private_key>
- require:
- cmd: load_private_gpg_key
Install pass binary
.. code-block:: yaml
pass:
pkg.installed
i ( t absolute_importt print_functiont unicode_literalsN( t
expanduser( t Popent PIPE( t SaltRenderError( t sixc C@ s/ t j j j d � } | r | St d � � d S( u6
Return the pass executable or raise an error
u passu pass unavailableN( t saltt utilst patht whichR ( t pass_exec( ( s7 /usr/lib/python2.7/site-packages/salt/renderers/pass.pyt _get_pass_execD s c C@ s� d j | j � � } t j d | � t | j d � d t d t �} | j � \ } } | j sh | r� t j d | | � | } n | j � S( ux
Fetch secret from pass based on pass_path. If there is
any error, return back the original pass_path value
u
pass show {0}u Fetching secret: %su t stdoutt stderru Could not fetch secret: %s %s(
t formatt stript logt debugR t splitR t communicatet
returncodet warning( t pass_patht cmdt proct pass_datat
pass_error( ( s7 /usr/lib/python2.7/site-packages/salt/renderers/pass.pyt
_fetch_secretO s ! c C@ s� t | t j � r t | � St | t � r^ xo t j | � D] \ } } t | � | | <q; Wn? t | t � r� x- t | � D] \ } } t | � | | <qz Wn | S( uU
Recursively try to find a pass path (string) that can be handed off to pass
( t
isinstanceR t string_typesR t dictt iteritemst _decrypt_objectt listt enumerate( t objt pass_keyR ( ( s7 /usr/lib/python2.7/site-packages/salt/renderers/pass.pyR"