community.vmware.vmware_first_class_disk_info 模块 – 收集有关 VMware vSphere 一级磁盘的信息
注意
此模块是 community.vmware 集合 (版本 5.2.0) 的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用: ansible-galaxy collection install community.vmware
。
要在剧本中使用它,请指定: community.vmware.vmware_first_class_disk_info
。
概要
此模块可用于收集有关 VMware vSphere 一级磁盘的信息。
参数
参数 |
注释 |
---|---|
数据中心的名称。 |
|
磁盘的数据存储或数据存储集群的名称。 |
|
磁盘的名称。如果未设置,则返回所有找到的磁盘。 |
|
vSphere vCenter 或 ESXi 服务器的主机名或 IP 地址。 如果任务中未指定此值,则将使用环境变量 |
|
vSphere vCenter 或 ESXi 服务器的密码。 如果任务中未指定此值,则将使用环境变量 |
|
将接收所有 HTTPS 请求并转发它们的 HTTP 代理的端口。 如果任务中未指定此值,则将使用环境变量 |
|
vSphere vCenter 或 ESXi 服务器的用户名。 如果任务中未指定此值,则将使用环境变量 |
|
允许在 SSL 证书无效时连接。当证书不受信任时,设置为 如果任务中未指定此值,则将使用环境变量 选项
|
备注
注意
所有模块都需要 API 写入权限,因此在免费的 ESXi 许可证上不支持。
所有变量和 VMware 对象名称都区分大小写。
示例
- name: Gather info of 1GBDisk
community.vmware.vmware_first_class_disk_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore_name: '{{ datastore_name }}'
disk_name: '1GBDisk'
register: disk_info
delegate_to: localhost
- debug:
var: disk_info.first_class_disks
- name: Gather info of all first class disks
community.vmware.vmware_first_class_disk_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datastore_name: '{{ datastore_name }}'
register: disk_info
delegate_to: localhost
- debug:
var: disk_info.first_class_disks
返回值
常见的返回值已在 此处 记录,以下是此模块特有的字段
键 |
描述 |
---|---|
一级磁盘及其信息的字典列表 返回:成功 示例: |