W3cubDocs

/Ansible

community.general.pritunl_user – Manage Pritunl Users using the Pritunl API

Note

This plugin is part of the community.general collection (version 3.8.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.pritunl_user.

New in version 2.3.0: of community.general

Synopsis

  • A module to manage Pritunl users using the Pritunl API.

Parameters

Parameter Choices/Defaults Comments
organization
string / required
The name of the organization the user is part of.

aliases: org
pritunl_api_secret
string / required
API Secret found in Administrators > USERNAME > API Secret.
pritunl_api_token
string / required
API Token of a Pritunl admin user.
It needs to be enabled in Administrators > USERNAME > Enable Token Authentication.
pritunl_url
string / required
URL and port of the Pritunl server on which the API is enabled.
state
string
    Choices:
  • present
  • absent
If present, the module adds user user_name to the Pritunl organization. If absent, removes the user user_name from the Pritunl organization.
user_disabled
boolean
    Choices:
  • no
  • yes
Enable/Disable the user user_name.
user_email
string
Email address associated with the user user_name.
user_gravatar
boolean
    Choices:
  • no
  • yes
Enable/Disable Gravatar usage for the user user_name.
user_groups
list / elements=string
List of groups associated with the user user_name.
user_name
string / required
Name of the user to create or delete from Pritunl.
user_type
string
    Choices:
  • client
  • server
Type of the user user_name.
validate_certs
boolean
    Choices:
  • no
  • yes
If certificates should be validated or not.
This should never be set to false, except if you are very sure that your connection to the server can not be subject to a Man In The Middle attack.

Examples

- name: Create the user Foo with email address [email protected] in MyOrg
  community.general.pritunl_user:
    state: present
    name: MyOrg
    user_name: Foo
    user_email: [email protected]

- name: Disable the user Foo but keep it in Pritunl
  community.general.pritunl_user:
    state: present
    name: MyOrg
    user_name: Foo
    user_email: [email protected]
    user_disabled: yes

- name: Make sure the user Foo is not part of MyOrg anymore
  community.general.pritunl_user:
    state: absent
    name: MyOrg
    user_name: Foo

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
response
dictionary
success
JSON representation of Pritunl Users.

Sample:
{'audit': False, 'auth_type': 'google', 'bypass_secondary': False, 'client_to_client': False, 'disabled': False, 'dns_mapping': None, 'dns_servers': None, 'dns_suffix': None, 'email': '[email protected]', 'gravatar': True, 'groups': ['foo', 'bar'], 'id': '5d070dafe63q3b2e6s472c3b', 'name': '[email protected]', 'network_links': [], 'organization': '58070daee6sf342e6e4s2c36', 'organization_name': 'Acme', 'otp_auth': True, 'otp_secret': '35H5EJA3XB2$4CWG', 'pin': False, 'port_forwarding': [], 'servers': []}


Authors

  • Florian Dambrine (@Lowess)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/pritunl_user_module.html