hetzner.hcloud.rdns 模块 – 在 Hetzner Cloud 上创建和管理反向 DNS 条目。
注意
此模块是 hetzner.hcloud 集合(版本 4.2.2)的一部分。
如果您正在使用 ansible 包,您可能已经安装了这个集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用:ansible-galaxy collection install hetzner.hcloud。您需要进一步的要求才能使用此模块,请参阅 要求 以了解详细信息。
要在 playbook 中使用它,请指定:hetzner.hcloud.rdns。
概要
- 在 Hetzner Cloud 上创建、更新和删除反向 DNS 条目。 
别名:hcloud_rdns
要求
执行此模块的主机需要满足以下要求。
- python-dateutil >= 2.7.5 
- requests >=2.20 
参数
| 参数 | 注释 | 
|---|---|
| Hetzner Cloud 的 API 端点。 您也可以使用  默认值:  | |
| Hetzner Cloud 的 API 令牌。 您也可以使用  | |
| ip_address 应该解析到的 DNS 地址。 省略该参数可将反向 DNS 条目重置为默认值。 | |
| 您要向其添加反向 DNS 条目的 Hetzner Cloud 浮动 IP 的名称或 ID。 | |
| 应指向 dns_ptr 的 IP 地址。 | |
| 您要向其添加反向 DNS 条目的 Hetzner Cloud 负载均衡器的名称或 ID。 | |
| 您要向其添加反向 DNS 条目的 Hetzner Cloud 主 IP 的名称或 ID。 | |
| 您要向其添加反向 DNS 条目的 Hetzner Cloud 服务器的名称或 ID。 | |
| 反向 DNS 条目的状态。 选项 
 | 
另请参阅
另请参阅
- Hetzner Cloud API 的文档
- Hetzner Cloud API 的完整参考。 
示例
- name: Create a reverse DNS entry for a server
  hetzner.hcloud.rdns:
    server: my-server
    ip_address: 123.123.123.123
    dns_ptr: example.com
    state: present
- name: Create a reverse DNS entry for a Floating IP
  hetzner.hcloud.rdns:
    floating_ip: my-floating-ip
    ip_address: 123.123.123.123
    dns_ptr: example.com
    state: present
- name: Create a reverse DNS entry for a Primary IP
  hetzner.hcloud.rdns:
    primary_ip: my-primary-ip
    ip_address: 123.123.123.123
    dns_ptr: example.com
    state: present
- name: Create a reverse DNS entry for a Load Balancer
  hetzner.hcloud.rdns:
    load_balancer: my-load-balancer
    ip_address: 123.123.123.123
    dns_ptr: example.com
    state: present
- name: Ensure the reverse DNS entry is absent (remove if needed)
  hetzner.hcloud.rdns:
    server: my-server
    ip_address: 123.123.123.123
    dns_ptr: example.com
    state: absent
返回值
常见的返回值记录在此处,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 反向 DNS 条目 返回: 始终 | |
| 解析到 IP 的 DNS 返回: 始终 示例:  | |
| 浮动 IP 的名称 返回: 始终 示例:  | |
| 指向 DNS ptr 的 IP 地址 返回: 始终 示例:  | |
| 负载均衡器的名称 返回: 始终 示例:  | |
| 主 IP 的名称 返回: 始终 示例:  | |
| 服务器的名称 返回: 始终 示例:  | 
