community.crypto.ecs_domain 模块 – 使用 Entrust 证书服务 (ECS) API 请求域验证

注意

此模块是 community.crypto 集合 (版本 2.22.3) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install community.crypto。您需要其他要求才能使用此模块,请参阅 要求 获取详细信息。

要在 playbook 中使用它,请指定:community.crypto.ecs_domain

community.crypto 1.0.0 中的新增功能

概要

要求

在执行此模块的主机上需要以下要求。

  • PyYAML >= 3.11

参数

参数

注释

client_id

整数

请求将域关联到的客户端 ID。

如果未指定客户端 ID,则域将在 ID 为 1 的主客户端下添加。

默认值: 1

domain_name

字符串 / 必需

要验证或重新验证的域名。

entrust_api_client_cert_key_path

路径 / 必需

用于向 Entrust 证书服务 (ECS) API 进行身份验证的客户端证书密钥的路径。

entrust_api_client_cert_path

路径 / 必需

用于向 Entrust 证书服务 (ECS) API 进行身份验证的客户端证书的路径。

entrust_api_key

字符串 / 必需

用于向 Entrust 证书服务 (ECS) API 进行身份验证的密钥(密码)。

entrust_api_specification_path

路径

定义 Entrust 证书服务 (ECS) API 配置的规范文件的路径。

您可以使用此路径保存规范文件的本地副本,避免每次使用模块时都下载。

默认值: "https://cloud.entrust.net/EntrustCloud/documentation/cms-api-2.1.0.yaml"

entrust_api_user

字符串 / 必需

Entrust 证书服务 (ECS) API 身份验证的用户名。

verification_email

字符串

用于验证域名所有权的电子邮件地址。

电子邮件地址必须是 domain_name 的 WHOIS 数据中存在的电子邮件地址,或者以下构造的电子邮件地址之一:admin@domain_name,administrator@domain_name,webmaster@domain_name,hostmaster@domain_name,postmaster@domain_name

请注意,如果 domain_name 包含子域名,则应使用顶级域名。例如,如果请求验证 example1.ansible.com 或 test.example2.ansible.com,并且您想使用预构造的“admin”名称,则电子邮件地址应为 admin@ansible.com

如果使用域或其顶级命名空间 WHOIS 数据中的电子邮件值,则必须完全匹配。

如果 verification_method=email 但未提供 verification_email,则将使用在域的 WHOIS 数据中找到的第一个电子邮件地址。

要验证域名所有权,域名所有者必须按照收到的电子邮件中的说明操作。

仅当 verification_method=email 时才允许。

verification_method

字符串 / 必需

用于证明控制域的验证方法。

如果 verification_method=email 并且指定了值 verification_email,则该值用于电子邮件验证。如果未提供 verification_email,则将使用 WHOIS 数据中存在的第一个值。将向 verification_email 中的地址发送一封电子邮件,其中包含有关如何验证域控制的说明。

如果 verification_method=dns,则必须将值 dns_contents 存储在位置 dns_location,DNS 记录类型为 dns_resource_type。要证明域名所有权,请更新您的 DNS 记录,以便 dns_contents 返回的文本字符串可在 dns_location 中访问。

如果 verification_method=web_server,则必须在可在位置 file_location 访问的 Web 服务器上提供返回值 file_contents 的内容。

如果 verification_method=manual,则域名将通过手动流程进行验证。不推荐此方法。

选项

  • "dns"

  • "email"

  • "manual"

  • "web_server"

属性

属性

支持

描述

check_mode

支持:不支持

可以在 check_mode 中运行,并在不修改目标的情况下返回更改状态预测。

diff_mode

支持:不支持

在差异模式下,将返回有关已更改内容(或可能需要在 check_mode 中更改的内容)的详细信息。

备注

注意

另请参阅

另请参阅

community.crypto.x509_certificate

可用于使用 provider=entrust 从 ECS 请求证书。

community.crypto.ecs_certificate

可用于使用已验证的域名从 ECS 请求证书。

示例

- name: Request domain validation using email validation for client ID of 2.
  community.crypto.ecs_domain:
    domain_name: ansible.com
    client_id: 2
    verification_method: email
    verification_email: [email protected]
    entrust_api_user: apiusername
    entrust_api_key: a^lv*32!cd9LnT
    entrust_api_client_cert_path: /etc/ssl/entrust/ecs-client.crt
    entrust_api_client_cert_key_path: /etc/ssl/entrust/ecs-client.key

- name: Request domain validation using DNS. If domain is already valid,
        request revalidation if expires within 90 days
  community.crypto.ecs_domain:
    domain_name: ansible.com
    verification_method: dns
    entrust_api_user: apiusername
    entrust_api_key: a^lv*32!cd9LnT
    entrust_api_client_cert_path: /etc/ssl/entrust/ecs-client.crt
    entrust_api_client_cert_key_path: /etc/ssl/entrust/ecs-client.key

- name: Request domain validation using web server validation, and revalidate
        if fewer than 60 days remaining of EV eligibility.
  community.crypto.ecs_domain:
    domain_name: ansible.com
    verification_method: web_server
    entrust_api_user: apiusername
    entrust_api_key: a^lv*32!cd9LnT
    entrust_api_client_cert_path: /etc/ssl/entrust/ecs-client.crt
    entrust_api_client_cert_key_path: /etc/ssl/entrust/ecs-client.key

- name: Request domain validation using manual validation.
  community.crypto.ecs_domain:
    domain_name: ansible.com
    verification_method: manual
    entrust_api_user: apiusername
    entrust_api_key: a^lv*32!cd9LnT
    entrust_api_client_cert_path: /etc/ssl/entrust/ecs-client.crt
    entrust_api_client_cert_key_path: /etc/ssl/entrust/ecs-client.key

返回值

常见返回值已记录在 此处,以下是此模块特有的字段

描述

client_id

整数

域名所属的客户端 ID。如果指定了输入值 client_id,则此值将始终与 client_id 相同。

返回:已更改或成功

示例: 1

dns_contents

字符串

ECS 期望在位于 dns_location 的 DNS 记录中找到的值。

返回:已更改,如果 verification_methoddns

示例: "AB23CD41432522FF2526920393982FAB"

dns_location

字符串

ECS 期望能够找到用于域名验证的 DNS 条目的位置,其中包含 dns_contents 的内容。

返回:已更改,如果 verification_methoddns

示例: "_pki-validation.ansible.com"

dns_resource_type

字符串

ECS 期望位于 dns_location 的 DNS 记录的资源记录类型。

返回:已更改,如果 verification_methoddns

示例: "TXT"

domain_status

字符串

当前域的状态。将是以下之一:APPROVEDDECLINEDCANCELLEDINITIAL_VERIFICATIONDECLINEDCANCELLEDRE_VERIFICATIONEXPIREDEXPIRING

返回:已更改或成功

示例: "APPROVED"

电子邮件

列表 / 元素=字符串

用于请求此域验证的电子邮件列表。

使用此模块请求的域将只有一个大小为1的列表。

返回值: verification_methodemail

示例: ["[email protected]", "[email protected]"]

ev_days_remaining

整数

域剩余可提交“EV”证书的天数。永远不会大于ov_days_remaining的值。

返回值:成功且ev_eligibletrue,并且domain_statusAPPROVEDRE_VERIFICATIONEXPIRING

示例: 94

ev_eligible

布尔值

域是否符合提交“EV”证书的条件。如果ov_eligiblefalse,则永远不会为true

返回值:成功且domain_statusAPPROVEDRE_VERIFICATIONEXPIRING,或EXPIRED

示例: true

file_contents

字符串

ECS 期望在file_location找到的文件的内容。

返回值: verification_methodweb_server

示例: "AB23CD41432522FF2526920393982FAB"

file_location

字符串

ECS 期望能够找到用于域验证的文件的位置,该文件包含file_contents的内容。

返回值: verification_methodweb_server

示例: "https://ansible.org.cn/.well-known/pki-validation/abcd.txt"

ov_days_remaining

整数

域剩余可提交“OV”证书的天数。永远不会小于ev_days_remaining的值。

返回值:成功且ov_eligibletrue,并且domain_statusAPPROVEDRE_VERIFICATIONEXPIRING

示例: 129

ov_eligible

布尔值

域是否符合提交“OV”证书的条件。如果ev_eligibletrue,则永远不会为false

返回值:成功且domain_statusAPPROVEDRE_VERIFICATIONEXPIRING,或EXPIRED

示例: true

verification_method

字符串

用于请求域验证的验证方法。如果changed将与verification_method输入参数相同。

返回:已更改或成功

示例: "dns"

作者

  • Chris Trufan (@ctrufan)