community.general.pritunl_user (8.5.0) — module

Manage Pritunl Users using the Pritunl API

| "added in version" 2.3.0 of community.general"

Authors: Florian Dambrine (@Lowess)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

A module to manage Pritunl users using the Pritunl API.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create the user Foo with email address foo@bar.com in MyOrg
  community.general.pritunl_user:
    state: present
    organization: MyOrg
    user_name: Foo
    user_email: foo@bar.com
    user_mac_addresses:
      - "00:00:00:00:00:99"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Disable the user Foo but keep it in Pritunl
  community.general.pritunl_user:
    state: present
    organization: MyOrg
    user_name: Foo
    user_email: foo@bar.com
    user_disabled: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Make sure the user Foo is not part of MyOrg anymore
  community.general.pritunl_user:
    state: absent
    organization: MyOrg
    user_name: Foo

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - If V(present), the module adds user O(user_name) to the Pritunl O(organization).
      If V(absent), removes the user O(user_name) from the Pritunl O(organization).
    type: str

user_name:
    default: null
    description:
    - Name of the user to create or delete from Pritunl.
    required: true
    type: str

user_type:
    choices:
    - client
    - server
    default: client
    description:
    - Type of the user O(user_name).
    required: false
    type: str

user_email:
    default: null
    description:
    - Email address associated with the user O(user_name).
    required: false
    type: str

pritunl_url:
    description:
    - URL and port of the Pritunl server on which the API is enabled.
    required: true
    type: str

user_groups:
    default: null
    description:
    - List of groups associated with the user O(user_name).
    elements: str
    required: false
    type: list

organization:
    aliases:
    - org
    description:
    - The name of the organization the user is part of.
    required: true
    type: str

user_disabled:
    default: null
    description:
    - Enable/Disable the user O(user_name).
    required: false
    type: bool

user_gravatar:
    default: null
    description:
    - Enable/Disable Gravatar usage for the user O(user_name).
    required: false
    type: bool

validate_certs:
    default: true
    description:
    - If certificates should be validated or not.
    - This should never be set to V(false), except if you are very sure that your connection
      to the server can not be subject to a Man In The Middle attack.
    required: false
    type: bool

pritunl_api_token:
    description:
    - API Token of a Pritunl admin user.
    - It needs to be enabled in Administrators > USERNAME > Enable Token Authentication.
    required: true
    type: str

pritunl_api_secret:
    description:
    - API Secret found in Administrators > USERNAME > API Secret.
    required: true
    type: str

user_mac_addresses:
    description:
    - Allowed MAC addresses for the user O(user_name).
    elements: str
    type: list
    version_added: 5.0.0
    version_added_collection: community.general

Outputs

response:
  description: JSON representation of Pritunl Users.
  returned: success
  sample:
    audit: false
    auth_type: google
    bypass_secondary: false
    client_to_client: false
    disabled: false
    dns_mapping: null
    dns_servers: null
    dns_suffix: null
    email: foo@bar.com
    gravatar: true
    groups:
    - foo
    - bar
    id: 5d070dafe63q3b2e6s472c3b
    name: foo@acme.com
    network_links: []
    organization: 58070daee6sf342e6e4s2c36
    organization_name: Acme
    otp_auth: true
    otp_secret: 35H5EJA3XB2$4CWG
    pin: false
    port_forwarding: []
    servers: []
  type: dict