Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/crypto/acme/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZmZm
Z
ddlmZd
�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: acme_account
author: "Felix Fontein (@felixfontein)"
version_added: "2.6"
short_description: Create, modify or delete ACME accounts
description:
   - "Allows to create, modify or delete accounts with a CA supporting the
      L(ACME protocol,https://tools.ietf.org/html/rfc8555),
      such as L(Let's Encrypt,https://letsencrypt.org/)."
   - "This module only works with the ACME v2 protocol."
notes:
   - "The M(acme_certificate) module also allows to do basic account management.
      When using both modules, it is recommended to disable account management
      for M(acme_certificate). For that, use the C(modify_account) option of
      M(acme_certificate)."
seealso:
  - name: Automatic Certificate Management Environment (ACME)
    description: The specification of the ACME protocol (RFC 8555).
    link: https://tools.ietf.org/html/rfc8555
  - module: acme_account_info
    description: Retrieves facts about an ACME account.
  - module: openssl_privatekey
    description: Can be used to create a private account key.
  - module: acme_inspect
    description: Allows to debug problems.
extends_documentation_fragment:
  - acme
options:
  state:
    description:
      - "The state of the account, to be identified by its account key."
      - "If the state is C(absent), the account will either not exist or be
         deactivated."
      - "If the state is C(changed_key), the account must exist. The account
         key will be changed; no other information will be touched."
    type: str
    required: true
    choices:
    - present
    - absent
    - changed_key
  allow_creation:
    description:
      - "Whether account creation is allowed (when state is C(present))."
    type: bool
    default: yes
  contact:
    description:
      - "A list of contact URLs."
      - "Email addresses must be prefixed with C(mailto:)."
      - "See U(https://tools.ietf.org/html/rfc8555#section-7.3)
         for what is allowed."
      - "Must be specified when state is C(present). Will be ignored
         if state is C(absent) or C(changed_key)."
    type: list
    elements: str
    default: []
  terms_agreed:
    description:
      - "Boolean indicating whether you agree to the terms of service document."
      - "ACME servers can require this to be true."
    type: bool
    default: no
  new_account_key_src:
    description:
      - "Path to a file containing the ACME account RSA or Elliptic Curve key to change to."
      - "Same restrictions apply as to C(account_key_src)."
      - "Mutually exclusive with C(new_account_key_content)."
      - "Required if C(new_account_key_content) is not used and state is C(changed_key)."
    type: path
  new_account_key_content:
    description:
      - "Content of the ACME account RSA or Elliptic Curve key to change to."
      - "Same restrictions apply as to C(account_key_content)."
      - "Mutually exclusive with C(new_account_key_src)."
      - "Required if C(new_account_key_src) is not used and state is C(changed_key)."
    type: str
sf
- name: Make sure account exists and has given contacts. We agree to TOS.
  acme_account:
    account_key_src: /etc/pki/cert/private/account.key
    state: present
    terms_agreed: yes
    contact:
    - mailto:[email protected]
    - mailto:[email protected]

- name: Make sure account has given email address. Don't create account if it doesn't exist
  acme_account:
    account_key_src: /etc/pki/cert/private/account.key
    state: present
    allow_creation: no
    contact:
    - mailto:[email protected]

- name: Change account's key to the one stored in the variable new_account_key
  acme_account:
    account_key_src: /etc/pki/cert/private/account.key
    new_account_key_content: '{{ new_account_key }}'
    state: changed_key

- name: Delete account (we have to use the new key)
  acme_account:
    account_key_content: '{{ new_account_key }}'
    state: absent
sq
account_uri:
  description: ACME account URI, or None if account does not exist.
  returned: always
  type: str
(tModuleFailExceptiontACMEAccounttset_crypto_backend(t
AnsibleModulec%C`setdtdtddddg�dtddd	t�d
tdd�dtdddd
�dtdddddddg�dtdddt�dtdddt�dtdddtddddg�dtdddt�dtdddddg�dtdd�d tddd	t�d!tdddd"dd"d#d$g��
d%ddgfd&ddgdd gfd'dddd gtgfd(t�}t|�|jjd�s�|jd)d*d+d,�n|jjd�dkr�|jd-d.�nyJt	|�}t}|jjd�}i}i}|dkr|j
dt�\}}|rqt|�}|jd/|d0<n|r�td1��n|dk	r�|js�id2d36}|j|j|�\}	}
|
d3d4kr�td5j|
d3|	���q�nt}q�n�|dkr|jjd�}g|jjd�D]}t|�^q2}
|jjd�}|j
|
d|d|�\}}|dkr�td-d6��n|r�i}nt|�}|jd/|d0<t}|s�|j||
�\}}n|p�|}t|�}|jd/|d0<n�|dkr�|j|jjd�|jjd ��\}}|rotd7|��n|j
dt�\}}|r�td1��n|dkr�td-d6��nt|�}|jd/|d0<|js�|jd8}i|d9d96|d/d/6|d:6}i|jd;6|d/d<6|jd=6}|j|||�}|j||�\}	}
|
d3d4kr�td>j|
d3|	���n|jr�||_|d9|jd9<|j�}q�n|jr�t|�}n|d/|d0<t}ni|d?6|jd
6}	|jr0i|d@6|dA6|	dB<n|j|	�Wn tk
r`}|j|�nXdS(CNt
argument_spectaccount_key_srcttypetpathtaliasestaccount_keytaccount_key_contenttstrtno_logtaccount_uritacme_directorytdefaults2https://acme-staging.api.letsencrypt.org/directorytacme_versiontintitchoicesitvalidate_certstbooltterms_agreedtstatetrequiredtabsenttpresenttchanged_keytallow_creationtcontacttlisttelementstnew_account_key_srctnew_account_key_contenttselect_crypto_backendtautotopenssltcryptographytrequired_one_oftmutually_exclusivetrequired_iftsupports_check_modetwarningsHDisabling certificate validation for communications with ACME endpoint. sEThis should only be done for testing against a local ACME server for s:development purposes, but *never* for production purposes.tmsgs6The acme_account module requires the ACME v2 protocol!tjwktpublic_account_keysUnwanted account creationtdeactivatedRi�s#Error deactivating account: {0} {1}s)Account does not exist or is deactivated.s#error while parsing account key: %st	keyChangetalgturltaccounttnewKeytoldKeys#Error account key rollover: {0} {1}tchangedtbeforetaftertdiff(RtdicttTruetFalseR
tparamstgettwarnt	fail_jsonR	t
setup_accounttkey_datatAssertionErrortNonet
check_modetsend_signed_requestturiRtformatRtupdate_accountt	parse_keyt	directoryR3tsign_requestt_difft
jws_headertget_account_datat	exit_jsontdo_fail(tmoduleR9R<Rtdiff_beforet
diff_aftertcreatedtaccount_datatpayloadtresulttinfoR#tvR$Rtupdatedterrortnew_key_dataR8t	protectedtdatate((sL/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account.pytmain�s�!$'		
		
"+		



				
	t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.acmeRR	R
tansible.module_utils.basicRRgt__name__(((sL/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account.pyt<module>s


Q	�

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