vmware.vmware_rest.content_library_item_info 模块 – 返回具有给定标识符的 ItemModel。
注意
此模块是 vmware.vmware_rest 集合(版本 4.3.0)的一部分。
如果您使用的是 ansible
包,则可能已经安装了此集合。 它不包含在 ansible-core
中。 要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install vmware.vmware_rest
。 您需要进一步的要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:vmware.vmware_rest.content_library_item_info
。
vmware.vmware_rest 2.0.0 中的新增功能
已弃用
- 在以下版本中删除:
版本 5.0.0
- 原因:
此模块已移至 新的 vmware.vmware 集合
- 替代方案:
概要
返回具有给定标识符的 ItemModel。
要求
在执行此模块的主机上需要以下要求。
vSphere 7.0.3 或更高版本
python >= 3.6
aiohttp
参数
参数 |
注释 |
---|---|
应返回其项目的库的标识符。 该参数必须是由 vmware.vmware_rest.content_library_info 返回的资源的 ID。 使用 state=['list'] 时是必需的 |
|
要返回的库项目的标识符。 该参数必须是由 vmware.vmware_rest.content_library_item_info 返回的资源的 ID。 使用 state=['get'] 时是必需的 |
|
客户端会话的超时设置。 整个操作(包括连接建立、请求发送和响应)的最大秒数。 默认值为 300 秒。 |
|
vSphere vCenter 的主机名或 IP 地址 如果未在任务中指定该值,则将使用环境变量 |
|
vSphere vCenter 密码 如果未在任务中指定该值,则将使用环境变量 |
|
您可以使用此可选参数来设置日志文件的位置。 此文件将用于记录 HTTP REST 交互。 该文件将存储在运行模块的主机上。 如果未在任务中指定该值,则将使用 环境变量 |
|
vSphere vCenter 用户名 如果未在任务中指定该值,则将使用环境变量 |
|
允许在 SSL 证书无效时连接。 当证书不受信任时,设置为 如果未在任务中指定该值,则将使用环境变量 选项
|
注释
注意
在 vSphere 7.0.3 上测试
示例
- name: Create a content library pointing on a NFS share
vmware.vmware_rest.content_locallibrary:
name: my_library_on_nfs
description: automated
publish_info:
published: true
authentication_method: NONE
storage_backings:
- storage_uri: nfs://datastore.test/srv/share/content-library
type: OTHER
state: present
register: nfs_lib
- name: Get the list of items of the NFS library
vmware.vmware_rest.content_library_item_info:
library_id: '{{ nfs_lib.id }}'
register: lib_items
- name: Get the list of items of the NFS library
vmware.vmware_rest.content_library_item_info:
library_id: '{{ nfs_lib.id }}'
register: result
- name: Create a new local content library
vmware.vmware_rest.content_locallibrary:
name: local_library_001
description: automated
publish_info:
published: true
authentication_method: NONE
storage_backings:
- datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}"
type: DATASTORE
state: present
register: ds_lib
- name: Get the (empty) list of items of the library
vmware.vmware_rest.content_library_item_info:
library_id: '{{ ds_lib.id }}'
register: result
- name: Create subscribed library
vmware.vmware_rest.content_subscribedlibrary:
name: sub_lib
subscription_info:
subscription_url: '{{ nfs_lib.value.publish_info.publish_url }}'
authentication_method: NONE
automatic_sync_enabled: false
on_demand: true
storage_backings:
- datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/rw_datastore') }}"
type: DATASTORE
register: sub_lib
- name: Ensure the OVF is here
vmware.vmware_rest.content_library_item_info:
library_id: '{{ sub_lib.id }}'
register: result
- name: Create a content library based on a DataStore
vmware.vmware_rest.content_locallibrary:
name: my_library_on_datastore
description: automated
publish_info:
published: true
authentication_method: NONE
storage_backings:
- datastore_id: "{{ lookup('vmware.vmware_rest.datastore_moid', '/my_dc/datastore/local') }}"
type: DATASTORE
state: present
register: nfs_lib
返回值
常见的返回值已在此处记录 此处,以下是此模块特有的字段
键 |
描述 |
---|---|
确保 OVF 在这里 返回:成功时 示例: |
状态
此模块将在版本 5.0.0 中删除。 [已弃用]
有关更多信息,请参阅 已弃用。