community.general.pritunl_org module – Manages Pritunl Organizations using the Pritunl API

Note

This module is part of the community.general collection (version 6.6.2).

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_org.

New in community.general 2.5.0

Synopsis

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

Parameters

Parameter

Comments

force

boolean

If force is true and state is absent, the module will delete the organization, no matter if it contains users or not. By default force is false, which will cause the module to fail the deletion of the organization when it contains users.

Choices:

  • false ← (default)

  • true

name

aliases: org

string / required

The name of the organization to manage in Pritunl.

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

If present, the module adds organization name to Pritunl. If absent, attempt to delete the organization from Pritunl (please read about force usage).

Choices:

  • "present" ← (default)

  • "absent"

validate_certs

boolean

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.

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Ensure the organization named MyOrg exists
  community.general.pritunl_org:
    state: present
    name: MyOrg

- name: Ensure the organization named MyOrg does not exist
  community.general.pritunl_org:
    state: absent
    name: MyOrg

Return Values

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

Key

Description

response

dictionary

JSON representation of a Pritunl Organization.

Returned: success

Sample: {"auth_api": false, "auth_secret": null, "auth_token": null, "id": "csftwlu6uhralzi2dpmhekz3", "name": "Foo", "user_count": 0}

Authors

  • Florian Dambrine (@Lowess)