effectivelywild.technitium_dns.technitium_dns_set_permission_details module – Set permission details for a specific section

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

New in effectivelywild.technitium_dns 0.5.0

Synopsis

  • Change permissions for a specific section.

  • Allows setting user permissions and group permissions with view, modify, and delete access.

  • Built-in groups (Administrators, DHCP Administrators, DNS Administrators) are automatically preserved and cannot be cleared.

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

groupPermissions

list / elements=dictionary

List of group permissions to set for this section

Each item should contain group name, canView, canModify, and canDelete

canDelete

boolean / required

Whether the group can delete from this section

Choices:

  • false

  • true

canModify

boolean / required

Whether the group can modify this section

Choices:

  • false

  • true

canView

boolean / required

Whether the group can view this section

Choices:

  • false

  • true

name

string / required

Group name to set permissions for

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

section

string / required

The name of the section to set permissions for

Should match a section name from the list permissions API call

userPermissions

list / elements=dictionary

List of user permissions to set for this section

Each item should contain username, canView, canModify, and canDelete

canDelete

boolean / required

Whether the user can delete from this section

Choices:

  • false

  • true

canModify

boolean / required

Whether the user can modify this section

Choices:

  • false

  • true

canView

boolean / required

Whether the user can view this section

Choices:

  • false

  • true

username

string / required

Username to set permissions for

validate_certs

boolean

Whether to validate SSL certificates when making API requests

Choices:

  • false

  • true ← (default)

See Also

Examples

- name: Set Dashboard permissions for a user
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Dashboard"
    userPermissions:
      - username: "testuser"
        canView: true
        canModify: true
        canDelete: false

- name: Set Cache permissions for a group
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Cache"
    groupPermissions:
      - name: "testgroup"
        canView: true
        canModify: true
        canDelete: true

- name: Set both user and group permissions for Zones
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Zones"
    userPermissions:
      - username: "user1"
        canView: true
        canModify: false
        canDelete: false
    groupPermissions:
      - name: "Administrators"
        canView: true
        canModify: true
        canDelete: true
      - name: "Everyone"
        canView: true
        canModify: false
        canDelete: false

- name: Clear all user permissions for a section
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Dashboard"
    userPermissions: []

- name: Clear all group permissions (built-in groups are preserved automatically)
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Dashboard"
    groupPermissions: []  # Built-in groups like Administrators will be preserved

- name: Set permissions on a specific cluster node
  technitium_dns_set_permission_details:
    api_url: "http://localhost"
    api_token: "myapitoken"
    section: "Dashboard"
    node: "node1.cluster.example.com"
    userPermissions:
      - username: "testuser"
        canView: true
        canModify: true
        canDelete: false

Return Values

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

Key

Description

api_response

dictionary

Complete raw API response from Technitium DNS

Returned: always

response

dictionary

Updated permission details from the API

Returned: success

groupPermissions

list / elements=dictionary

Updated group permissions for this section

Returned: always

section

string

The name of the permission section

Returned: always

Sample: "Dashboard"

userPermissions

list / elements=dictionary

Updated user permissions for this section

Returned: always

status

string

API response status

Returned: always

Sample: "ok"

changed

boolean

Whether the module made changes

Returned: always

Sample: true

diff

dictionary

Dictionary showing what changed, with current and desired values

Returned: when changes are made

Sample: {"userPermissions": {"current": [], "desired": [{"canDelete": false, "canModify": true, "canView": true, "username": "testuser"}]}}

failed

boolean

Whether the module failed

Returned: always

Sample: false

msg

string

Human readable message describing the result

Returned: always

Sample: "Permissions updated successfully for section 'Dashboard'."

Authors

  • Frank Muise (@effectivelywild)