ansible.builtin.acme_certificate_revoke (v2.8.20) — module

Revoke certificates with the ACME protocol

| "added in version" 2.7 of ansible.builtin"

Authors: Felix Fontein (@felixfontein)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.8.20

Description

Allows to revoke certificates issued by a CA supporting the L(ACME protocol,https://tools.ietf.org/html/rfc8555), such as L(Let's Encrypt,https://letsencrypt.org/).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Revoke certificate with account key
  acme_certificate_revoke:
    account_key_src: /etc/pki/cert/private/account.key
    certificate: /etc/httpd/ssl/sample.com.crt
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Revoke certificate with certificate's private key
  acme_certificate_revoke:
    private_key_src: /etc/httpd/ssl/sample.com.key
    certificate: /etc/httpd/ssl/sample.com.crt

Inputs

    
account_uri:
    description:
    - If specified, assumes that the account URI is as given. If the account key does
      not match this account, or an account with this URI does not exist, the module fails.
    type: str

certificate:
    description:
    - Path to the certificate to revoke.
    required: true
    type: path

acme_version:
    choices:
    - 1
    - 2
    description:
    - The ACME version of the endpoint.
    - Must be C(1) for the classic Let's Encrypt and Buypass ACME endpoints, or C(2) for
      standardized ACME v2 endpoints.
    - The default value is C(1). Note that in community.crypto 2.0.0, this option B(will
      be required) and will no longer have a default.
    - Please also note that we will deprecate ACME v1 support eventually.
    type: int

revoke_reason:
    description:
    - One of the revocation reasonCodes defined in L(https://tools.ietf.org/html/rfc5280#section-5.3.1,
      Section 5.3.1 of RFC5280).
    - Possible values are C(0) (unspecified), C(1) (keyCompromise), C(2) (cACompromise),
      C(3) (affiliationChanged), C(4) (superseded), C(5) (cessationOfOperation), C(6)
      (certificateHold), C(8) (removeFromCRL), C(9) (privilegeWithdrawn), C(10) (aACompromise)
    type: int

acme_directory:
    description:
    - The ACME directory to use. This is the entry point URL to access the ACME CA server
      API.
    - For safety reasons the default is set to the Let's Encrypt staging server (for the
      ACME v1 protocol). This will create technically correct, but untrusted certificates.
    - The default value is C(https://acme-staging.api.letsencrypt.org/directory). Note
      that in community.crypto 2.0.0, this option B(will be required) and will no longer
      have a default. Note that the default is the Let's Encrypt staging server for the
      ACME v1 protocol, which is deprecated and will be disabled in May 2021 (see L(here,https://community.letsencrypt.org/t/end-of-life-plan-for-acmev1/88430/7)
      for details).
    - 'For Let''s Encrypt, all staging endpoints can be found here: U(https://letsencrypt.org/docs/staging-environment/).
      For Buypass, all endpoints can be found here: U(https://community.buypass.com/t/63d4ay/buypass-go-ssl-endpoints)'
    - For B(Let's Encrypt), the production directory URL for ACME v2 is U(https://acme-v02.api.letsencrypt.org/directory).
      (The production directory URL for ACME v1 is U(https://acme-v01.api.letsencrypt.org/directory)
      and will be disabled in July 2021.)
    - For B(Buypass), the production directory URL for ACME v2 and v1 is U(https://api.buypass.com/acme/directory).
    - For B(ZeroSSL), the production directory URL for ACME v2 is U(https://acme.zerossl.com/v2/DV90).
    - B(Warning:) So far, the ACME modules have only been tested against Let's Encrypt
      (staging and production), Buypass (staging and production), ZeroSSL (production),
      and L(Pebble testing server,https://github.com/letsencrypt/Pebble). If you experience
      problems with another ACME server, please L(create an issue,https://github.com/ansible-collections/community.crypto/issues/new/choose)
      to help us supporting it. Feedback that an ACME server not mentioned does work is
      also appreciated.
    type: str

validate_certs:
    default: true
    description:
    - Whether calls to the ACME directory will validate TLS certificates.
    - B(Warning:) Should B(only ever) be set to C(no) for testing purposes, for example
      when testing against a local Pebble server.
    type: bool

account_key_src:
    aliases:
    - account_key
    description:
    - Path to a file containing the ACME account RSA or Elliptic Curve key.
    - RSA keys can be created with C(openssl rsa ...). Elliptic curve keys can be created
      with C(openssl ecparam -genkey ...). Any other tool creating private keys in PEM
      format can be used as well.
    - Mutually exclusive with C(account_key_content).
    - Required if C(account_key_content) is not used.
    type: path

private_key_src:
    description:
    - Path to the certificate's private key.
    - Note that exactly one of C(account_key_src), C(account_key_content), C(private_key_src)
      or C(private_key_content) must be specified.
    type: path

account_key_content:
    description:
    - Content of the ACME account RSA or Elliptic Curve key.
    - Note that exactly one of C(account_key_src), C(account_key_content), C(private_key_src)
      or C(private_key_content) must be specified.
    - "I(Warning): the content will be written into a temporary file, which will be deleted\
      \ by Ansible when the module completes. Since this is an important private key \u2014\
      \ it can be used to change the account key, or to revoke your certificates without\
      \ knowing their private keys \u2014, this might not be acceptable."
    - In case C(cryptography) is used, the content is not written into a temporary file.
      It can still happen that it is written to disk by Ansible in the process of moving
      the module with its argument to the node where it is executed.
    type: str

private_key_content:
    description:
    - Content of the certificate's private key.
    - Note that exactly one of C(account_key_src), C(account_key_content), C(private_key_src)
      or C(private_key_content) must be specified.
    - "I(Warning): the content will be written into a temporary file, which will be deleted\
      \ by Ansible when the module completes. Since this is an important private key \u2014\
      \ it can be used to change the account key, or to revoke your certificates without\
      \ knowing their private keys \u2014, this might not be acceptable."
    - In case C(cryptography) is used, the content is not written into a temporary file.
      It can still happen that it is written to disk by Ansible in the process of moving
      the module with its argument to the node where it is executed.
    type: str

select_crypto_backend:
    choices:
    - auto
    - cryptography
    - openssl
    default: auto
    description:
    - Determines which crypto backend to use.
    - The default choice is C(auto), which tries to use C(cryptography) if available,
      and falls back to C(openssl).
    - If set to C(openssl), will try to use the C(openssl) binary.
    - If set to C(cryptography), will try to use the L(cryptography,https://cryptography.io/)
      library.
    type: str

account_key_passphrase:
    description:
    - Phassphrase to use to decode the account key.
    - B(Note:) this is not supported by the C(openssl) backend, only by the C(cryptography)
      backend.
    type: str
    version_added: 1.6.0
    version_added_collection: community.crypto

See also