effectivelywild.technitium_dns.technitium_dns_create_token module – Create an API token for a user
Note
This module is part of the effectivelywild.technitium_dns collection (version 0.9.1).
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 effectivelywild.technitium_dns.
To use it in a playbook, specify: effectivelywild.technitium_dns.technitium_dns_create_token.
New in effectivelywild.technitium_dns 0.5.0
Synopsis
Create a non-expiring API token.
The token allows access to API calls with the same privileges as that of the user.
Parameters
Parameter |
Comments |
|---|---|
Port for the Technitium DNS API. Defaults to 5380 Default: |
|
API token for authenticating with the Technitium DNS API |
|
Base URL for the Technitium DNS API |
|
Whether to return the actual API token value in the response WARNING: Setting this to true will expose the sensitive API token in Ansible logs, fact cache, and console output Choices:
|
|
The name of the created token to identify its session |
|
The username for the user account for which to generate the API token |
|
Whether to validate SSL certificates when making API requests Choices:
|
See Also
See also
- effectivelywild.technitium_dns.technitium_dns_list_sessions
List active user sessions
- effectivelywild.technitium_dns.technitium_dns_create_user
Create a user account
- effectivelywild.technitium_dns.technitium_dns_list_users
List all users
Examples
- name: Create an API token for a user
technitium_dns_create_token:
api_url: "http://localhost"
api_token: "myapitoken"
user: "testuser"
tokenName: "MyToken1"
- name: Create API token and return the actual token value (for testing)
technitium_dns_create_token:
api_url: "http://localhost"
api_token: "myapitoken"
user: "testuser"
tokenName: "MyToken1"
return_token: true
register: token_result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Complete raw API response from Technitium DNS Returned: always |
|
The core data payload from the API Returned: always |
|
The generated API token (sensitive information) or ‘[NEW_TOKEN_HIDDEN]’ if return_token is false Returned: always Sample: |
|
Name of the created token Returned: always Sample: |
|
Username for which the token was created Returned: always Sample: |
|
API response status Returned: always Sample: |
|
Whether the module made changes to create a new token Returned: always Sample: |
|
Whether the module failed to complete the token creation Returned: always Sample: |
|
Human-readable message describing the token creation result Returned: always Sample: |