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 才能使用此模块。

参数

参数

注释

clustername

字符串 / 必需

Storage Virtualize 系统的hostname或管理IP。

command

字符串

要在 Storage Virtualize 系统上执行的单个 svcinfo CLI 命令。

key_filename

字符串

SSH 客户端私钥文件名。默认情况下,使用 ~/.ssh/id_rsa

log_path

字符串

调试日志文件的路径。

password

字符串 / 必需

Storage Virtualize 系统的密码。

username

字符串 / 必需

Storage Virtualize 系统的用户名。

usesshkey

字符串

对于基于密钥对的 SSH 连接,请将此字段设置为 'yes'。在 key_filename 字段中提供密钥文件的完整路径。如果未提供,则使用 SSH 密钥的默认路径。

选项

  • "yes"

  • "no" ←(默认)

示例

- 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

作者

  • Shilpi Jain (@Shilpi-Jain1)