dellemc.openmanage.ome_profile 模块 – 在 OpenManage Enterprise 上创建、修改、删除、分配、取消分配和迁移配置文件
注意
此模块是 dellemc.openmanage 集合 (版本 9.9.0) 的一部分。
如果您正在使用 ansible
包,则可能已安装此集合。它不包含在 ansible-core
中。要检查它是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install dellemc.openmanage
。您需要其他需求才能使用此模块,有关详细信息,请参阅 需求。
要在剧本中使用它,请指定:dellemc.openmanage.ome_profile
。
dellemc.openmanage 3.1.0 中的新增功能
概要
此模块允许在 OpenManage Enterprise 上创建、修改、删除、分配、取消分配和迁移配置文件。
需求
执行此模块的主机需要以下需求。
python >= 3.9.6
参数
参数 |
注释 |
---|---|
用于 |
|
当 command 为 当 command 为 如果属性 ID 可用,则使用 Id。如果不可用,则使用以逗号分隔的 I (DisplayName)。有关使用 DisplayName 的更多详细信息,请参阅提供的示例。 |
|
提供不同的关闭选项。 当 command 为 |
|
配置文件部署计划。 当 command 为 |
|
共享 ISO 的详细信息。 当 command 为 |
|
启用或禁用网络共享。 选项
|
|
指定完整的 ISO 路径,包括共享名称。 |
|
设置网络 ISO 文件将保持映射到目标设备的时间(小时)。 选项
|
|
网络共享的 IP 地址。 |
|
当 share_type 为 |
|
网络共享的类型。 选项
|
|
当 share_type 为 |
|
当 share_type 为 |
|
包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。 |
|
选项
|
|
配置文件的描述。 |
|
目标设备的 ID。 当 command 为 此选项与 device_service_tag 互斥。 |
|
目标设备的标识符。 这通常是 7 到 8 个字符的长度。 当 command 为 此选项与 device_id 互斥。 当 command 为 |
|
根据选定的条件筛选配置文件。 当 command 为 这支持子选项 ProfileIds,它接受配置文件 ID 列表。 此模块还支持使用子选项 *Filters* 的 OData 过滤器表达式。 有关可用的过滤选项,请参阅 OpenManage Enterprise REST API 指南。 警告 当此选项与 |
|
提供一个选项,即使无法联系源设备,也可以强制迁移配置文件。 此选项仅在 *command* 为 选项
|
|
OpenManage Enterprise 或 OpenManage Enterprise Modular 的 IP 地址或主机名。 |
|
配置文件的名称。 这适用于修改、删除、分配、取消分配和迁移操作。 此选项与 *name_prefix* 和 *number_of_profiles* 互斥。 |
|
创建配置文件时提供的名称用作前缀,后跟 OpenManage Enterprise 为其分配的编号。 此选项仅适用于创建操作。 此选项与 *name* 互斥。 默认值: |
|
配置文件的新名称。 仅在 *command* 为 |
|
要创建的配置文件数量。 此选项仅在使用 此选项与 *name* 互斥。 OpenManage Enterprise 最多可以创建 100 个配置文件。 默认值: |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular 的密码。 如果未提供密码,则使用环境变量 示例:export OME_PASSWORD=password |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular 的 HTTPS 端口。 默认值: |
|
模板的 ID。 此选项仅在 *command* 为 此选项与 *template_name* 互斥。 |
|
用于创建配置文件的模板名称。 此选项仅在 *command* 为 此选项与 *template_id* 互斥。 |
|
套接字级别超时(秒)。 默认值: |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular 的用户名。 如果未提供用户名,则使用环境变量 示例:export OME_USERNAME=username |
|
如果为 仅在使用自签名证书的个人控制站点上配置 在集合版本 选项
|
|
身份验证令牌。 如果未提供 x_auth_token,则使用环境变量 示例:export OME_X_AUTH_TOKEN=x_auth_token |
备注
注意
从可以直接访问 Dell OpenManage Enterprise 的系统运行此模块。
此模块支持
check_mode
。对已分配配置文件的
assign
操作不会重新部署。
示例
---
- name: Create two profiles from a template
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
template_name: "template 1"
name_prefix: "omam_profile"
number_of_profiles: 2
- name: Create profile with NFS share
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: create
template_name: "template 1"
name_prefix: "omam_profile"
number_of_profiles: 1
boot_to_network_iso:
boot_to_network: true
share_type: NFS
share_ip: "192.168.0.1"
iso_path: "path/to/my_iso.iso"
iso_timeout: 8
- name: Create profile with CIFS share
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: create
template_name: "template 1"
name_prefix: "omam_profile"
number_of_profiles: 1
boot_to_network_iso:
boot_to_network: true
share_type: CIFS
share_ip: "192.168.0.2"
share_user: "username"
share_password: "password"
workgroup: "workgroup"
iso_path: "\\path\\to\\my_iso.iso"
iso_timeout: 8
- name: Modify profile name with NFS share and attributes
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: modify
name: "Profile 00001"
new_name: "modified profile"
description: "new description"
boot_to_network_iso:
boot_to_network: true
share_type: NFS
share_ip: "192.168.0.3"
iso_path: "path/to/my_iso.iso"
iso_timeout: 8
attributes:
Attributes:
- Id: 4506
Value: "server attr 1"
IsIgnored: false
- Id: 4507
Value: "server attr 2"
IsIgnored: false
# Enter the comma separated string as appearing in the Detailed view on GUI
# System -> Server Topology -> ServerTopology 1 Aisle Name
- DisplayName: 'System, Server Topology, ServerTopology 1 Aisle Name'
Value: Aisle 5
IsIgnored: false
- name: Delete a profile using profile name
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "delete"
name: "Profile 00001"
- name: Delete profiles using filters
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "delete"
filters:
SelectAll: true
Filters: =contains(ProfileName,'Profile 00002')
- name: Delete profiles using profile list filter
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "delete"
filters:
ProfileIds:
- 17123
- 16124
- name: Assign a profile to target along with network share
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: assign
name: "Profile 00001"
device_id: 12456
boot_to_network_iso:
boot_to_network: true
share_type: NFS
share_ip: "192.168.0.1"
iso_path: "path/to/my_iso.iso"
iso_timeout: 8
attributes:
Attributes:
- Id: 4506
Value: "server attr 1"
IsIgnored: true
Options:
ShutdownType: 0
TimeToWaitBeforeShutdown: 300
EndHostPowerState: 1
StrictCheckingVlan: true
Schedule:
RunNow: true
RunLater: false
- name: Unassign a profile using profile name
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "unassign"
name: "Profile 00003"
- name: Unassign profiles using filters
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "unassign"
filters:
SelectAll: true
Filters: =contains(ProfileName,'Profile 00003')
- name: Unassign profiles using profile list filter
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "unassign"
filters:
ProfileIds:
- 17123
- 16123
- name: Migrate a profile
dellemc.openmanage.ome_profile:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
command: "migrate"
name: "Profile 00001"
device_id: 12456
返回值
常见的返回值已在此处记录,以下是此模块独有的字段
键 |
描述 |
---|---|
HTTP 错误的详细信息。 返回: HTTP 错误时 示例: |
|
当 *command* 为
返回: 当 *command* 为 示例: |
|
配置文件操作的总体状态。 返回: 始终返回 示例: |
|
已创建配置文件的 ID。 返回: 当 *command* 为 示例: |