infoblox.nios_modules.nios_srv_record 模块 – 配置 Infoblox NIOS SRV 记录
注意
此模块是 infoblox.nios_modules 集合 (版本 1.7.1) 的一部分。
如果您使用的是 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install infoblox.nios_modules
。您需要其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:infoblox.nios_modules.nios_srv_record
。
infoblox.nios_modules 1.0.0 中的新增功能
概要
从 Infoblox NIOS 服务器添加和/或删除 SRV 记录对象的实例。此模块使用通过 REST 的 Infoblox WAPI 接口管理 NIOS
record:srv
对象。
要求
执行此模块的主机需要以下要求。
infoblox-client
参数
参数 |
注释 |
---|---|
配置要与此对象的实例关联的文本字符串注释。提供的文本字符串将在对象实例上配置。 |
|
允许在对象实例上配置可扩展属性。此参数接受一组用于配置的键/值对。 |
|
指定要从系统中添加或删除的完全限定主机名。用户还可以更新名称,因为可以传递包含new_name、old_name 的字典。请参阅示例。 |
|
配置此 SRV 记录的端口 (0-65535)。 |
|
配置此 SRV 记录的优先级 (0-65535)。 |
|
一个包含连接详细信息的字典对象。 |
|
指定客户端证书文件,其中包含 x509 配置的摘要,以便为 NIOS 的远程实例提供额外的安全连接层。 也可以使用 |
|
指定用于通过 REST 连接到 NIOS WAPI 远程实例的 DNS 主机名或地址 也可以使用 |
|
在此处插入描述 默认值: |
|
在此处插入描述 默认值: |
|
在收到响应之前等待的时间 也可以使用 默认值: |
|
指定私钥文件,用于使用证书进行加密,以便与 NIOS 的远程实例连接。 也可以使用 |
|
指定要返回的最大对象数,如果设置为负数,则当返回的对象数超过设置时,设备将返回错误。 也可以使用 默认值: |
|
配置在声明连接可用之前尝试的重试次数 也可以使用 默认值: |
|
指定用于验证与 NIOS 远程实例连接的密码。 也可以使用 |
|
在此处插入描述 选择
|
|
配置用于验证与 NIOS 远程实例连接的用户名。 也可以使用 |
|
用于启用或禁用验证 SSL 证书的布尔值 也可以使用 选择
|
|
指定要使用的 WAPI 版本 也可以使用 在 Ansible 2.8 版本之前,默认的 WAPI 版本是 1.4。 默认: |
|
配置 NIOS 服务器上对象的预期状态。当此值设置为 选择
|
|
配置此 SRV 记录的目标 FQDN。 |
|
配置要与此主机记录关联的 TTL。 |
|
设置与此记录关联的 DNS 视图。DNS 视图必须已在系统上配置。 默认: |
|
配置此 SRV 记录的权重 (0-65535)。 |
说明
注意
此模块支持
check_mode
。此模块必须在本地运行,可以通过指定
connection: local
来实现。请阅读 :ref:`nios_guide` 以获取有关如何将 Infoblox 与 Ansible 结合使用的更多详细信息。
示例
- name: Configure an SRV record
infoblox.nios_modules.nios_srv_record:
name: _sip._tcp.service.ansible.com
port: 5080
priority: 10
target: service1.ansible.com
weight: 10
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
- name: Add a comment to an existing SRV record
infoblox.nios_modules.nios_srv_record:
name: _sip._tcp.service.ansible.com
port: 5080
priority: 10
target: service1.ansible.com
weight: 10
comment: this is a test comment
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
- name: Update name of SRV record
infoblox.nios_modules.nios_srv_record:
name: {old_name: _sip._tcp.service.ansible.com, new_name: _sip._udp.service.ansible.com}
port: 5080
priority: 10
target: service1.ansible.com
weight: 10
state: present
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local
- name: Remove an SRV record from the system
infoblox.nios_modules.nios_srv_record:
name: _sip._tcp.service.ansible.com
port: 5080
priority: 10
target: service1.ansible.com
weight: 10
state: absent
provider:
host: "{{ inventory_hostname_short }}"
username: admin
password: admin
connection: local