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_info.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZmZm
Z
mZddlmZd
�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: acme_account_info
author: "Felix Fontein (@felixfontein)"
version_added: "2.7"
short_description: Retrieves information on ACME accounts
description:
   - "Allows to retrieve information on accounts 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_account) module allows to modify, create and delete ACME accounts."
   - "This module was called C(acme_account_facts) before Ansible 2.8. The usage
      did not change."
options:
  retrieve_orders:
    description:
      - "Whether to retrieve the list of order URLs or order objects, if provided
         by the ACME server."
      - "A value of C(ignore) will not fetch the list of orders."
      - "Currently, Let's Encrypt does not return orders, so the C(orders) result
         will always be empty."
    type: str
    choices:
      - ignore
      - url_list
      - object_list
    default: ignore
    version_added: "2.9"
seealso:
  - module: acme_account
    description: Allows to create, modify or delete an ACME account.
extends_documentation_fragment:
  - acme
s
- name: Check whether an account with the given account key exists
  acme_account_info:
    account_key_src: /etc/pki/cert/private/account.key
    register: account_data
- name: Verify that account exists
  assert:
    that:
      - account_data.exists
- name: Print account URI
  debug: var=account_data.account_uri
- name: Print account contacts
  debug: var=account_data.account.contact

- name: Check whether the account exists and is accessible with the given account key
  acme_account_info:
    account_key_content: "{{ acme_account_key }}"
    account_uri: "{{ acme_account_uri }}"
    register: account_data
- name: Verify that account exists
  assert:
    that:
      - account_data.exists
- name: Print account contacts
  debug: var=account_data.account.contact
st
exists:
  description: Whether the account exists.
  returned: always
  type: bool

account_uri:
  description: ACME account URI, or None if account does not exist.
  returned: always
  type: str

account:
  description: The account information, as retrieved from the ACME server.
  returned: if account exists
  type: dict
  contains:
    contact:
      description: the challenge resource that must be created for validation
      returned: always
      type: list
      elements: str
      sample: "['mailto:[email protected]', 'tel:00123456789']"
    status:
      description: the account's status
      returned: always
      type: str
      choices: ['valid', 'deactivated', 'revoked']
      sample: valid
    orders:
      description:
        - A URL where a list of orders can be retrieved for this account.
        - Use the I(retrieve_orders) option to query this URL and retrieve the
          complete list of orders.
      returned: always
      type: str
      sample: https://example.ca/account/1/orders
    public_account_key:
      description: the public account key as a L(JSON Web Key,https://tools.ietf.org/html/rfc7517).
      returned: always
      type: str
      sample: '{"kty":"EC","crv":"P-256","x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4","y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM"}'

orders:
  description:
    - "The list of orders."
    - "If I(retrieve_orders) is C(url_list), this will be a list of URLs."
    - "If I(retrieve_orders) is C(object_list), this will be a list of objects."
  type: list
  #elements: ... depends on retrieve_orders
  returned: if account exists, I(retrieve_orders) is not C(ignore), and server supports order listing
  contains:
    status:
      description: The order's status.
      type: str
      choices:
        - pending
        - ready
        - processing
        - valid
        - invalid
    expires:
      description:
        - When the order expires.
        - Timestamp should be formatted as described in RFC3339.
        - Only required to be included in result when I(status) is C(pending) or C(valid).
      type: str
      returned: when server gives expiry date
    identifiers:
      description:
        - List of identifiers this order is for.
      type: list
      elements: dict
      contains:
        type:
          description: Type of identifier. C(dns) or C(ip).
          type: str
        value:
          description: Name of identifier. Hostname or IP address.
          type: str
        wildcard:
          description: "Whether I(value) is actually a wildcard. The wildcard
                        prefix C(*.) is not included in I(value) if this is C(true)."
          type: bool
          returned: required to be included if the identifier is wildcarded
    notBefore:
      description:
        - The requested value of the C(notBefore) field in the certificate.
        - Date should be formatted as described in RFC3339.
        - Server is not required to return this.
      type: str
      returned: when server returns this
    notAfter:
      description:
        - The requested value of the C(notAfter) field in the certificate.
        - Date should be formatted as described in RFC3339.
        - Server is not required to return this.
      type: str
      returned: when server returns this
    error:
      description:
        - In case an error occurred during processing, this contains information about the error.
        - The field is structured as a problem document (RFC7807).
      type: dict
      returned: when an error occurred
    authorizations:
      description:
        - A list of URLs for authorizations for this order.
      type: list
      elements: str
    finalize:
      description:
        - A URL used for finalizing an ACME order.
      type: str
    certificate:
      description:
        - The URL for retrieving the certificate.
      type: str
      returned: when certificate was issued
(tModuleFailExceptiontACMEAccounttset_crypto_backendt
process_links(t
AnsibleModulec`s�g}x�|r�|j|dtdt�\}}|jd�sb|r^|jdj|��nPn|j|d�g��fd�}t||��jd�|�j	d�}}||kr	d}q	q	W|S(s5
    Retrieves orders list (handles pagination).
    tparse_json_resultt
fail_on_errortorderss;When retrieving orders list part {0}, got empty result listc`s |dkr�j|�ndS(Ntnext(tappend(tlinktrelation(tnew_orders_url(sQ/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account_info.pytf�siN(
tget_requesttTruetgettwarntformattextendRRtNonetpop(tmoduletaccountt
orders_urlRtrestinfoRtprevious_orders_url((RsQ/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account_info.pytget_orders_list�s 	!


cC`s|j|dtdt�dS(s
    Retrieve order data.
    R
Ri(RR(Rt	order_url((sQ/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account_info.pyt	get_order�scC`s�tdtdtddddg�dtddd	t�d
tdd�dtdddd
�dtdddddddg�dtdddt�dtddddddddg�dtddddddddg��dddgfdddgfdt�}|jd kr*|jd!d"d#�nt|�|jjd�sa|jd$d%d&d'�n|jjd�dkr�|j	d(d)�nyAt
|�}|jgd*td+t�\}}|r�t
d,��nitd-6|jdk	d.6|jd
6}|jdk	r�d/|kr g|d/<n|jd0|d1<||d2<|jd3�r�|jddkr�t|||d3�}|jddkr�||d3<q�g|D]}t||�^q�|d3<q�n|j|�Wn tk
r�}|j|�nXdS(4Nt
argument_spectaccount_key_srcttypetpathtaliasestaccount_keytaccount_key_contenttstrtno_logtaccount_uritacme_directorytdefaults2https://acme-staging.api.letsencrypt.org/directorytacme_versiontintitchoicesitvalidate_certstbooltselect_crypto_backendtautotopenssltcryptographytretrieve_orderstignoreturl_listtobject_listtrequired_one_oftmutually_exclusivetsupports_check_modetacme_account_factssGThe 'acme_account_facts' module has been renamed to 'acme_account_info'tversions2.12twarningsHDisabling 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!tallow_creationt remove_account_uri_if_not_existssUnwanted account creationtchangedtexiststcontacttjwktpublic_account_keyRR(RtdictRt_namet	deprecateR
tparamsRRt	fail_jsonR	t
setup_accounttFalsetAssertionErrorturiRtkey_dataR$R&t	exit_jsonRtdo_fail(RRtcreatedtaccount_datatresultRtorderte((sQ/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account_info.pytmain�s^!$'	
	


"
,t__main__N(t
__future__RRRR)t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.acmeRR	R
Rtansible.module_utils.basicRR$R&R_t__name__(((sQ/usr/lib/python2.7/site-packages/ansible/modules/crypto/acme/acme_account_info.pyt<module>s


&x"			@

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