community.general.pritunl_user 模块 – 使用 Pritunl API 管理 Pritunl 用户
注意
此模块是 community.general 集合 (版本 10.1.0) 的一部分。
如果您使用的是 ansible 包,则可能已安装此集合。它不包含在 ansible-core 中。要检查是否已安装它,请运行 ansible-galaxy collection list。
要安装它,请使用: ansible-galaxy collection install community.general。
要在 playbook 中使用它,请指定: community.general.pritunl_user。
community.general 2.3.0 中的新增功能
概要
- 一个使用 Pritunl API 管理 Pritunl 用户的模块。 
参数
| 参数 | 注释 | 
|---|---|
| 用户所属组织的名称。 | |
| 在管理员 > 用户名 > API 密钥中找到的 API 密钥。 | |
| Pritunl 管理员用户的 API 令牌。 需要在管理员 > 用户名 > 启用令牌身份验证中启用。 | |
| 启用了 API 的 Pritunl 服务器的 URL 和端口。 | |
| 如果为  选项 
 | |
| 与用户  | |
| 与用户  | |
| 用户  | |
| 要创建或从 Pritunl 删除的用户的名称。 | |
| 是否应验证证书。 除非您非常确定与服务器的连接不会受到中间人攻击,否则绝不应该将其设置为 选项 
 | 
属性
| 属性 | 支持 | 描述 | 
|---|---|---|
| 支持:不支持 | 可以在 | |
| 支持:不支持 | 在差异模式下,将返回关于已更改内容(或可能需要在 | 
示例
- name: Create the user Foo with email address [email protected] in MyOrg
  community.general.pritunl_user:
    state: present
    organization: MyOrg
    user_name: Foo
    user_email: [email protected]
    user_mac_addresses:
      - "00:00:00:00:00:99"
- name: Disable the user Foo but keep it in Pritunl
  community.general.pritunl_user:
    state: present
    organization: MyOrg
    user_name: Foo
    user_email: [email protected]
    user_disabled: true
- name: Make sure the user Foo is not part of MyOrg anymore
  community.general.pritunl_user:
    state: absent
    organization: MyOrg
    user_name: Foo
返回值
常见的返回值已在此处记录,以下是此模块特有的字段
| 键 | 描述 | 
|---|---|
| Pritunl用户的JSON表示。 返回:成功 示例: | 
