dellemc.openmanage.ome_user 模块 – 在 OpenManage Enterprise 上创建、修改或删除用户
注意
此模块是 dellemc.openmanage 集合(版本 9.9.0)的一部分。
如果您正在使用 ansible
包,则可能已经安装了此集合。它不包含在 ansible-core
中。要检查是否已安装,请运行 ansible-galaxy collection list
。
要安装它,请使用:ansible-galaxy collection install dellemc.openmanage
。您需要进一步的要求才能使用此模块,请参阅 要求 以了解详细信息。
要在剧本中使用它,请指定:dellemc.openmanage.ome_user
。
dellemc.openmanage 2.0.0 中的新增功能
概要
此模块在 OpenManage Enterprise 上创建、修改或删除用户。
要求
执行此模块的主机需要以下要求。
python >= 3.9.6
参数
参数 |
注释 |
---|---|
用户操作的有效负载数据。它可以为 UserTypeId、DirectoryServiceId、Description、Name、Password、UserName、RoleId、Locked、Enabled。 如果未为操作提供必需的参数,OME 将抛出错误。 有关更多详细信息,请参阅 OpenManage Enterprise API 参考指南。 默认值: |
|
包含用于验证的 CA 证书的隐私增强邮件 (PEM) 文件。 |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular IP 地址或主机名。 |
|
要删除的用户的唯一名称。 对于 |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular 密码。 如果未提供密码,则使用环境变量 示例:export OME_PASSWORD=password |
|
OpenManage Enterprise 或 OpenManage Enterprise Modular HTTPS 端口。 默认值: |
|
如果 attributes 中提供的 UserName 不存在,则 如果 attributes 中提供的 UserName 存在,则
选择
|
|
套接字级别的超时时间(以秒为单位)。 默认值: |
|
要删除的用户的唯一 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
。
示例
---
- name: Create user with required parameters
dellemc.openmanage.ome_user:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
attributes:
UserName: "user1"
Password: "UserPassword"
RoleId: "10"
Enabled: true
- name: Create user with all parameters
dellemc.openmanage.ome_user:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
attributes:
UserName: "user2"
Description: "user2 description"
Password: "UserPassword"
RoleId: "10"
Enabled: true
DirectoryServiceId: 0
UserTypeId: 1
Locked: false
Name: "user2"
- name: Modify existing user
dellemc.openmanage.ome_user:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
state: "present"
attributes:
UserName: "user3"
RoleId: "10"
Enabled: true
Description: "Modify user Description"
- name: Delete existing user using id
dellemc.openmanage.ome_user:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
state: "absent"
user_id: 1234
- name: Delete existing user using name
dellemc.openmanage.ome_user:
hostname: "192.168.0.1"
username: "username"
password: "password"
ca_path: "/path/to/ca_cert.pem"
state: "absent"
name: "name"
返回值
常见的返回值记录在此处,以下是此模块独有的字段
键 |
描述 |
---|---|
用户操作的总体状态。 返回: 始终 示例: |
|
当state为 返回: 当state为 示例: |