wti.remote.cpm_serial_port_action_set 模块 – 在 WTI OOB 和 PDU 设备中设置串口连接/断开命令

注意

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

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

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

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

wti.remote 2.9.0 中的新增功能

概要

  • 在 WTI OOB 和 PDU 设备中设置串口连接/断开命令

参数

参数

注释

action

整数

这是要分配给端口的波特率。

1=连接,2=断开

选项

  • 1

  • 2

cpm_password

字符串 / 必需

这是要发送到模块的 WTI 设备的密码。

cpm_url

字符串 / 必需

这是要发送到模块的 WTI 设备的 URL。

cpm_username

字符串 / 必需

这是要发送到模块的 WTI 设备的用户名。

port

整数 / 必需

这是要对其执行操作的端口号。

portremote

整数

这是要对其执行操作的端口号。

use_https

布尔值

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

选项

  • false

  • true ← (默认)

use_proxy

布尔值

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

选项

  • false ← (默认)

  • true

validate_certs

布尔值

如果为 false,则不会验证 SSL 证书。这仅应在使用自签名证书的个人控制站点上使用。

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

选项

  • false

  • true ← (默认)

备注

注意

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

示例

# Set Serial Port Action (Connect)
- name: Connect port 2 to port 3 of a WTI device
  cpm_serial_port_action_set:
    cpm_url: "nonexist.wti.com"
    cpm_username: "super"
    cpm_password: "super"
    use_https: true
    validate_certs: false
    port: "2"
    portremote: "3"
    action: "1"

# Set Serial port Action (Disconnect)
- name: Disconnect port 2 and 3 of a WTI device
  cpm_serial_port_action_set:
    cpm_url: "nonexist.wti.com"
    cpm_username: "super"
    cpm_password: "super"
    use_https: true
    validate_certs: false
    port: "2"
    action: "2"

返回值

常用返回值已在 此处 记录,以下是此模块特有的字段

描述

data

字符串

发送的命令返回的输出 JSON

返回:始终

作者

  • Western Telematic Inc. (@wtinetworkgear)