Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/clustering/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/clustering/etcd3.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZm
Z
dd
lmZyddlZeZWn#ek
r�e
j�ZeZnXd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: etcd3
short_description: "Set or delete key value pairs from an etcd3 cluster"
version_added: "2.5"
requirements:
  - etcd3
description:
   - Sets or deletes values in etcd3 cluster using its v3 api.
   - Needs python etcd3 lib to work
options:
    key:
        description:
            - the key where the information is stored in the cluster
        required: true
    value:
        description:
            - the information stored
        required: true
    host:
        description:
            - the IP address of the cluster
        default: 'localhost'
    port:
        description:
            - the port number used to connect to the cluster
        default: 2379
    state:
        description:
            - the state of the value for the key.
            - can be present or absent
        required: true
    user:
        description:
            - The etcd user to authenticate with.
        version_added: '2.8'
    password:
        description:
            - The password to use for authentication.
            - Required if I(user) is defined.
        version_added: '2.8'
    ca_cert:
        description:
            - The Certificate Authority to use to verify the etcd host.
            - Required if I(client_cert) and I(client_key) are defined.
        version_added: '2.8'
    client_cert:
        description:
            - PEM formatted certificate chain file to be used for SSL client authentication.
            - Required if I(client_key) is defined.
        version_added: '2.8'
    client_key:
        description:
            - PEM formatted file that contains your private key to be used for SSL client authentication.
            - Required if I(client_cert) is defined.
        version_added: '2.8'
    timeout:
        description:
            - The socket level timeout in seconds.
        version_added: '2.8'
author:
    - Jean-Philippe Evrard (@evrardjp)
    - Victor Fauth (@vfauth)
so
# Store a value "bar" under the key "foo" for a cluster located "http://localhost:2379"
- etcd3:
    key: "foo"
    value: "baz3"
    host: "localhost"
    port: 2379
    state: "present"

# Authenticate using user/password combination with a timeout of 10 seconds
- etcd3:
    key: "foo"
    value: "baz3"
    state: "present"
    user: "someone"
    password: "password123"
    timeout: 10

# Authenticate using TLS certificates
- etcd3:
    key: "foo"
    value: "baz3"
    state: "present"
    ca_cert: "/etc/ssl/certs/CA_CERT.pem"
    client_cert: "/etc/ssl/certs/cert.crt"
    client_key: "/etc/ssl/private/key.pem"
s�
key:
    description: The key that was queried
    returned: always
    type: str
old_value:
    description: The previous value in the cluster
    returned: always
    type: str
N(t
AnsibleModuletmissing_required_lib(t	to_nativec
C`s_tdtdddt�dtdddt�dtdddd�d	tdd
dd�dtdddtd
ddg�dtdd�dtdddt�dtdd�dtdd�dtdd�dtdd
��}tdt�}td|dtdddgddgg�}|jddkrS|jddk	rS|jdd�n|jjd�|d<|jjd�|jd<|jjd�|jd<t	s�|jdt
d �d!t�ndd	ddddddg}t�}x6|jj�D]%\}}||kr�|||<q�q�Wyt
j|�}Wn9tk
rn}|jdd"t|�d!tj��nXy|j|jd�}	Wn9tk
r�}|jdd#t|�d!tj��nXt|	d$�|d%<|jddkr�|	d$dk	rN|jrt|d<q�y|j|jd�WnFtk
rr}|jdd&|jdt|�fd!tj��q�Xt|d<qNn�|jddkr>|d%|jdkrN|jr�t|d<q;y"|j|jd|jd�WnFtk
r-}|jdd'|jdt|�fd!tj��q;Xt|d<qNn|jdd(�|j|�dS()Ntkeyttypetstrtrequiredtvaluethosttdefaultt	localhosttporttintiK	tstatetchoicestpresenttabsenttusertpasswordtno_logtca_certtpathtclient_certt
client_keyttimeouttchangedt
argument_spectsupports_check_modetrequired_togethertmsgsXThe 'ca_cert' parameter must be defined when 'client_cert' and 'client_key' are present.t	cert_certtcert_keytetcd3t	exceptions"Cannot connect to etcd cluster: %ssCannot reach data: %sit	old_valuesCannot delete %s: %ssCannot add or edit key %s: %ssState not recognized(tdicttTruetFalseRtparamstNonet	fail_jsontgettpoptHAS_ETCDR	tETCD_IMP_ERRtitemsR(tclientt	ExceptionR
t	tracebackt
format_exct
check_modetdeletetputt	exit_json(
tmodule_argstresulttmoduletallowed_keyst
client_paramsRRtetcdtexpt
cluster_value((sD/usr/lib/python2.7/site-packages/ansible/modules/clustering/etcd3.pyt
run_module�s�!	&		
&	
"&cC`st�dS(N(RF(((sD/usr/lib/python2.7/site-packages/ansible/modules/clustering/etcd3.pytmain�st__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR8tansible.module_utils.basicRR	tansible.module_utils._textR
R(R,R3tImportErrorR9R4R-RFRGt__name__(((sD/usr/lib/python2.7/site-packages/ansible/modules/clustering/etcd3.pyt<module>s*

B


	q	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]