community.general.dnsimple 模块 – 与 dnsimple.com (DNS 托管服务) 交互
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您正在使用 ansible
包,您可能已经安装了这个集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.general
。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:community.general.dnsimple
。
概要
通过 DNSimple API 管理域和记录,请参阅文档:http://developer.dnsimple.com/。
要求
执行此模块的主机需要以下要求。
dnsimple >= 2.0.0
参数
参数 |
注释 |
---|---|
帐户 API 令牌。有关更多信息,请参阅 |
|
帐户电子邮件。如果省略,将查找环境变量 如果找不到这些,将查找
|
|
要使用的域。可以是域名(例如“mydomain.com”)或 DNSimple 中域的数字 ID。 如果省略,将返回域列表。 如果存在域但该域不存在,则将创建该域。 |
|
记录优先级。 |
|
要添加的记录,如果为空,将为该域创建一个记录,支持通配符 (*)。 |
|
要确保存在或不存在的记录列表。 |
|
使用 DNSimple 沙箱环境。 需要在 dnsimple 沙箱环境中拥有一个专用帐户。 有关更多信息,请查看 https://developer.dnsimple.com/sandbox/。 选择
|
|
记录是否应该存在。 选择
|
|
以秒为单位为新记录设置的 TTL。 默认值: |
|
要创建的 DNS 记录类型。 选择
|
|
记录值。 尝试确保记录存在时必须指定。 |
属性
属性 |
支持 |
描述 |
---|---|---|
支持: 完全 |
可以在 |
|
支持: 无 |
当处于 diff 模式时,将返回有关已更改的内容(或可能需要在 |
示例
- name: Authenticate using email and API token and fetch all domains
community.general.dnsimple:
account_email: [email protected]
account_api_token: dummyapitoken
delegate_to: localhost
- name: Delete a domain
community.general.dnsimple:
domain: my.com
state: absent
delegate_to: localhost
- name: Create a test.my.com A record to point to 127.0.0.1
community.general.dnsimple:
domain: my.com
record: test
type: A
value: 127.0.0.1
delegate_to: localhost
register: record
- name: Delete record using record_ids
community.general.dnsimple:
domain: my.com
record_ids: '{{ record["id"] }}'
state: absent
delegate_to: localhost
- name: Create a my.com CNAME record to example.com
community.general.dnsimple:
domain: my.com
record: ''
type: CNAME
value: example.com
state: present
delegate_to: localhost
- name: Change TTL value for a record
community.general.dnsimple:
domain: my.com
record: ''
type: CNAME
value: example.com
ttl: 600
state: present
delegate_to: localhost
- name: Delete the record
community.general.dnsimple:
domain: my.com
record: ''
type: CNAME
value: example.com
state: absent
delegate_to: localhost