ibm.storage_virtualize.ibm_svcinfo_command 模块 – 此模块实现 SSH 客户端,帮助在 IBM Storage Virtualize 系列系统上运行 svcinfo CLI 命令
注意
此模块是 ibm.storage_virtualize 集合(版本 2.5.0)的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install ibm.storage_virtualize
。
要在剧本中使用它,请指定:ibm.storage_virtualize.ibm_svcinfo_command
。
ibm.storage_virtualize 1.2.0 中的新增功能
概要
在 IBM Storage Virtualize 系列系统上运行单个 svcinfo CLI 命令。此模块中的命令不支持诸如 filtervalue 或管道 ‘|’ 与 grep、awk 等的过滤选项。必须安装 Paramiko 才能使用此模块。
参数
参数 |
注释 |
---|---|
Storage Virtualize 系统的hostname或管理IP。 |
|
要在 Storage Virtualize 系统上执行的单个 svcinfo CLI 命令。 |
|
SSH 客户端私钥文件名。默认情况下,使用 |
|
调试日志文件的路径。 |
|
Storage Virtualize 系统的密码。 |
|
Storage Virtualize 系统的用户名。 |
|
对于基于密钥对的 SSH 连接,请将此字段设置为 选项
|
示例
- name: Run svcinfo CLI command using SSH client with password
ibm.storage_virtualize.ibm_svcinfo_command:
command: "svcinfo lsuser {{user}}"
clustername: "{{clustername}}"
username: "{{username}}"
password: "{{password}}"
log_path: /tmp/ansible.log
- name: Run svcinfo CLI command using passwordless SSH Client
ibm.storage_virtualize.ibm_svcinfo_command:
command: "svcinfo lsuser"
usesshkey: "yes"
clustername: "{{clustername}}"
username: "{{username}}"
password:
log_path: /tmp/ansible.log
- name: Run sainfo CLI command
ibm.storage_virtualize.ibm_svcinfo_command:
command: "sainfo lsservicenodes"
clustername: "{{clustername}}"
username: "{{username}}"
password: "{{password}}"
log_path: /tmp/ansible.log