community.general.oneandone_public_ip 模块 – 配置 1&1 公共 IP
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install community.general。您需要其他要求才能使用此模块,请参阅 要求 以了解详细信息。
要在 playbook 中使用它,请指定: community.general.oneandone_public_ip。
概要
- 创建、更新和删除公共 IP。此模块依赖于 1and1 >= 1.0。 
要求
执行此模块的主机需要以下要求。
- 1and1 
参数
| 参数 | 注释 | 
|---|---|
| 自定义 API URL。覆盖 ONEANDONE_API_URL 环境变量。 | |
| 1&1 提供的认证 API 令牌。 | |
| 将创建 IP 的数据中心的 ID(仅适用于未分配的 IP)。 选项 
 | |
| 用于更新和删除状态的公共 IP 的 ID。 | |
| 反向 DNS 名称。maxLength=256 | |
| 定义要创建、删除或更新的公共 IP 状态。 选项 
 | |
| IP 类型。目前,只有 IPV4 可用。 选项 
 | |
| 等待实例处于“运行”状态后再返回 选项 
 | |
| 定义使用 _wait_for 方法时要等待的秒数 默认值:  | |
| 等待超时时间(秒) 默认值:  | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:完全支持 | 可以在  | |
| 支持:不支持 | 处于 diff 模式时,将返回有关已更改内容(或可能需要在  | 
示例
- name: Create a public IP
  community.general.oneandone_public_ip:
    auth_token: oneandone_private_api_key
    reverse_dns: example.com
    datacenter: US
    type: IPV4
- name: Update a public IP
  community.general.oneandone_public_ip:
    auth_token: oneandone_private_api_key
    public_ip_id: public ip id
    reverse_dns: secondexample.com
    state: update
- name: Delete a public IP
  community.general.oneandone_public_ip:
    auth_token: oneandone_private_api_key
    public_ip_id: public ip id
    state: absent
返回值
公共返回值已在 此处 记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| 关于已处理的公共 IP 的信息 返回:始终返回 示例:  | 
