%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/renderers/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/renderers/pass.pyc

�
���^c@@s�dZddlmZmZmZddlZddlZddlmZddl	m
Z
mZddlZ
ddlmZddlmZeje�Zd�Zd	�Zd
�Zdddd
�ZdS(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(tabsolute_importtprint_functiontunicode_literalsN(t
expanduser(tPopentPIPE(tSaltRenderError(tsixcC@s/tjjjd�}|r|Std��dS(u6
    Return the pass executable or raise an error
    upassupass unavailableN(tsalttutilstpathtwhichR(t	pass_exec((s7/usr/lib/python2.7/site-packages/salt/renderers/pass.pyt_get_pass_execDscC@s�dj|j��}tjd|�t|jd�dtdt�}|j�\}}|jsh|r�tj	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}uFetching secret: %su tstdouttstderruCould not fetch secret: %s %s(
tformattstriptlogtdebugRtsplitRtcommunicatet
returncodetwarning(t	pass_pathtcmdtproct	pass_datat
pass_error((s7/usr/lib/python2.7/site-packages/salt/renderers/pass.pyt
_fetch_secretOs!	cC@s�t|tj�rt|�St|t�r^xotj|�D]\}}t|�||<q;Wn?t|t�r�x-t|�D]\}}t|�||<qzWn|S(uU
    Recursively try to find a pass path (string) that can be handed off to pass
    (	t
isinstanceRtstring_typesRtdictt	iteritemst_decrypt_objecttlistt	enumerate(tobjtpass_keyR((s7/usr/lib/python2.7/site-packages/salt/renderers/pass.pyR"bs
ubaseucK@s?yt�Wntk
r!�nXtd�tjd<t|�S(u3
    Fetch secret from pass based on pass_path
    u~uHOME(R
RRtostenvironR"(t	pass_infotsaltenvtslstarglinetkwargs((s7/usr/lib/python2.7/site-packages/salt/renderers/pass.pytrenderqs
(t__doc__t
__future__RRRtloggingR'tos.pathRt
subprocessRRtsalt.utils.pathRtsalt.exceptionsRtsalt.extRt	getLoggert__name__RR
RR"R.(((s7/usr/lib/python2.7/site-packages/salt/renderers/pass.pyt<module>1s			

Zerion Mini Shell 1.0