wti.remote.cpm_dnsservices_config 模块 – 在 WTI OOB 和 PDU 设备中设置网络 DNS 服务参数

注意

此模块是 wti.remote 集合(版本 1.0.10)的一部分。

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

要安装它,请使用:ansible-galaxy collection install wti.remote

要在 playbook 中使用它,请指定:wti.remote.cpm_dnsservices_config

wti.remote 2.10.0 中的新增功能

概要

  • 在 WTI OOB 和 PDU 设备中设置网络 DNS 服务参数

参数

参数

注释

cpm_password

字符串 / 必需

这是 WTI 设备的密码,用于发送模块。如果

cpm_username 为空,则此参数被假定为用户令牌。

cpm_url

字符串 / 必需

这是 WTI 设备的 URL,用于发送模块。

cpm_username

字符串

这是 WTI 设备的用户名,用于发送模块。如果此值

为空,则 cpm_password 被假定为用户令牌。

dnsservers

列表 / 元素=字符串 / 必需

要发送到 WTI 设备的实际 DNS 服务器。

index

列表 / 元素=整数

应插入 DNS 服务器的索引。如果未定义,则条目将从位置 1 开始。

use_https

布尔值

指定使用 https 连接还是 http 连接。

选择

  • false

  • true ← (默认)

use_proxy

布尔值

标志,用于控制当存在 HTTP 代理环境变量时,查找是否会遵循这些变量。

选择

  • false ← (默认)

  • true

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。这应该只在

使用自签名证书的个人控制站点上使用。

选择

  • false

  • true ← (默认)

备注

注意

  • module_defaults 中使用 groups/cpm 来设置 CPM 模块之间使用的常用选项。

示例

# Set Network DNS Services Parameters
- name: Set the an DNS Services Parameter for a WTI device
  cpm_dnsservices_config:
    cpm_url: "nonexist.wti.com"
    cpm_username: "super"
    cpm_password: "super"
    use_https: true
    validate_certs: false
    dnsservers: "8.8.8.8"

# Set Network DNS Services Parameters using a User Token
- name: Set the an DNS Services Parameter for a WTI device
  cpm_dnsservices_config:
    cpm_url: "nonexist.wti.com"
    cpm_username: ""
    cpm_password: "randomusertokenfromthewtidevice"
    use_https: true
    validate_certs: false
    dnsservers: "8.8.4.4"

# Sets multiple Network DNS Services Parameters
- name: Set the DNS Services Parameters a WTI device
  cpm_dnsservices_config:
    cpm_url: "nonexist.wti.com"
    cpm_username: "super"
    cpm_password: "super"
    use_https: true
    validate_certs: false
    index:
      - 1
      - 2
    dnsservers:
      - "8.8.8.8"
      - "8.8.4.4"

返回值

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

描述

数据

复杂

从发送的命令返回的输出 JSON

已返回: 始终

dnsservices

字典

模块执行后,WTI 设备的接口信息的当前键值对。

已返回: 始终

示例: {"servers": [{"dnsserver1": [{"ip": "166.216.138.41"}], "dnsserver2": [{"ip": "166.216.138.42"}], "dnsserver3": [{"ip": "8.8.8.8"}], "dnsserver4": [{"ip": ""}]}]}

作者

  • Western Telematic Inc. (@wtinetworkgear)