community.general.oneview_san_manager 模块 – 管理 OneView SAN 管理器资源
注意
此模块是 community.general 集合(版本 10.1.0)的一部分。
如果您使用的是 ansible
包,您可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install community.general
。您需要满足其他要求才能使用此模块,请参阅 要求 了解详细信息。
要在 playbook 中使用它,请指定:community.general.oneview_san_manager
。
概要
提供用于管理 SAN 管理器资源的接口。可以创建、更新或删除。
要求
在执行此模块的主机上需要满足以下要求。
Python >= 2.7.9
hpOneView >= 3.1.1
参数
参数 |
注释 |
---|---|
OneView API 版本。 |
|
JSON 配置文件路径,其中包含 OneView 客户端配置。配置文件是可选的,当使用时应存在于运行 Ansible 命令的主机中。如果未提供文件路径,则将从环境变量加载配置。有关示例配置文件或如何使用环境变量的链接,请验证注释部分。 |
|
包含 SAN 管理器属性的列表。 |
|
设备的 IP 地址或主机名。 |
|
HPE Image Streamer REST API 的 IP 地址或主机名。 |
|
用于 API 身份验证的密码。 |
|
指示上行链路集资源的期望状态。 - 选项
|
|
用于 API 身份验证的用户名。 |
|
启用 ETag 验证后,仅当资源的当前 ETag 与数据中提供的 ETag 匹配时,才会条件性地处理请求。 选项
|
属性
属性 |
支持 |
描述 |
---|---|---|
支持:无 |
可以在 |
|
支持:无 |
在差异模式下运行时,将返回有关已更改内容(或可能需要在 |
注释
注意
可以在以下位置找到 config 参数的示例配置文件:https://github.com/HewlettPackard/oneview-ansible/blob/master/examples/oneview_config-rename.json
请查看以下位置,了解如何使用环境变量进行配置:https://github.com/HewlettPackard/oneview-ansible#environment-variables
可以在以下位置找到 HPE OneView Ansible 模块的其他 Playbook:https://github.com/HewlettPackard/oneview-ansible/tree/master/examples
使用的 OneView API 版本将直接影响资源中返回和预期的字段。有关设置所需 API 版本的信息,请参阅:https://github.com/HewlettPackard/oneview-ansible#setting-your-oneview-version
示例
- name: Creates a Device Manager for the Brocade SAN provider with the given hostname and credentials
community.general.oneview_san_manager:
config: /etc/oneview/oneview_config.json
state: present
data:
providerDisplayName: Brocade Network Advisor
connectionInfo:
- name: Host
value: 172.18.15.1
- name: Port
value: 5989
- name: Username
value: username
- name: Password
value: password
- name: UseSsl
value: true
delegate_to: localhost
- name: Ensure a Device Manager for the Cisco SAN Provider is present
community.general.oneview_san_manager:
config: /etc/oneview/oneview_config.json
state: present
data:
name: 172.18.20.1
providerDisplayName: Cisco
connectionInfo:
- name: Host
value: 172.18.20.1
- name: SnmpPort
value: 161
- name: SnmpUserName
value: admin
- name: SnmpAuthLevel
value: authnopriv
- name: SnmpAuthProtocol
value: sha
- name: SnmpAuthString
value: password
delegate_to: localhost
- name: Sets the SAN Manager connection information
community.general.oneview_san_manager:
config: /etc/oneview/oneview_config.json
state: connection_information_set
data:
connectionInfo:
- name: Host
value: '172.18.15.1'
- name: Port
value: '5989'
- name: Username
value: 'username'
- name: Password
value: 'password'
- name: UseSsl
value: true
delegate_to: localhost
- name: Refreshes the SAN Manager
community.general.oneview_san_manager:
config: /etc/oneview/oneview_config.json
state: present
data:
name: 172.18.15.1
refreshState: RefreshPending
delegate_to: localhost
- name: Delete the SAN Manager recently created
community.general.oneview_san_manager:
config: /etc/oneview/oneview_config.json
state: absent
data:
name: '172.18.15.1'
delegate_to: localhost
返回值
常见返回值记录在此处,以下是此模块特有的字段
键 |
描述 |
---|---|
包含有关 SAN 管理器的 OneView 信息。 返回:在状态为“present”时返回。可以为 null。 |