effectivelywild.technitium_dns.technitium_dns_list_users module – List all users

Note

This module is part of the effectivelywild.technitium_dns collection (version 1.1.2).

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

New in effectivelywild.technitium_dns 0.4.0

Synopsis

  • Retrieve a list of all users.

Parameters

Parameter

Comments

api_port

integer

Port for the Technitium DNS API. Defaults to 5380

Default: 5380

api_token

string / required

API token for authenticating with the Technitium DNS API

api_url

string / required

Base URL for the Technitium DNS API

node

string

The node domain name for which this API call is intended

When unspecified, the current node is used

This parameter can be used only when Clustering is initialized

validate_certs

boolean

Whether to validate SSL certificates when making API requests.

Choices:

  • false

  • true ← (default)

See Also

Examples

- name: List all users from Technitium DNS
  technitium_dns_list_users:
    api_url: "http://localhost"
    api_token: "myapitoken"
  register: result

- debug:
    var: result.users

- name: List users on a specific cluster node
  technitium_dns_list_users:
    api_url: "http://localhost"
    api_token: "myapitoken"
    node: "node1.cluster.example.com"
  register: result

- name: Check if a specific user exists
  technitium_dns_list_users:
    api_url: "http://localhost"
    api_token: "myapitoken"
  register: users_result

- name: Verify admin user exists
  assert:
    that:
      - users_result.users | selectattr('username', 'equalto', 'admin') | list | length > 0
    fail_msg: "Admin user not found"

Return Values

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

Key

Description

changed

boolean

Whether the module made changes (always false for list operations)

Returned: always

Sample: false

failed

boolean

Whether the module failed

Returned: always

Sample: false

users

list / elements=dictionary

List of users from the Technitium DNS server

Returned: always

disabled

boolean

Whether the user account is disabled

Returned: always

Sample: false

displayName

string

Display name of the user

Returned: always

Sample: "Administrator"

previousSessionLoggedOn

string

Timestamp of previous session login (ISO 8601 format)

Returned: always

Sample: "2022-09-17T13:20:32.7933783Z"

previousSessionRemoteAddress

string

Remote IP address of previous session

Returned: always

Sample: "127.0.0.1"

recentSessionLoggedOn

string

Timestamp of most recent session login (ISO 8601 format)

Returned: always

Sample: "2022-09-17T13:22:45.671081Z"

recentSessionRemoteAddress

string

Remote IP address of most recent session

Returned: always

Sample: "127.0.0.1"

username

string

Username for the user account

Returned: always

Sample: "admin"

Authors

  • Frank Muise (@effectivelywild)