effectivelywild.technitium_dns.technitium_dns_list_dhcp_scopes module – List all DHCP scopes from Technitium DNS server

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

New in effectivelywild.technitium_dns 0.6.0

Synopsis

  • Retrieve a list of all DHCP scopes.

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

validate_certs

boolean

Whether to validate SSL certificates when making API requests.

Choices:

  • false

  • true ← (default)

See Also

Examples

- name: List all DHCP scopes from Technitium DNS
  technitium_dns_list_dhcp_scopes:
    api_url: "http://localhost"
    api_token: "myapitoken"
  register: result

- debug:
    var: result.scopes

- name: Check if a specific scope exists
  technitium_dns_list_dhcp_scopes:
    api_url: "http://localhost"
    api_token: "myapitoken"
  register: scopes_result

- name: Verify Default scope exists
  assert:
    that:
      - scopes_result.scopes | selectattr('name', 'equalto', 'Default') | list | length > 0
    fail_msg: "Default scope 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

scopes

list / elements=dictionary

List of DHCP scopes from the Technitium DNS server

Returned: always

broadcastAddress

string

Broadcast address of the DHCP scope

Returned: always

Sample: "192.168.1.255"

enabled

boolean

Whether the DHCP scope is enabled

Returned: always

Sample: false

endingAddress

string

Ending IP address of the DHCP scope

Returned: always

Sample: "192.168.1.254"

name

string

Name of the DHCP scope

Returned: always

Sample: "Default"

networkAddress

string

Network address of the DHCP scope

Returned: always

Sample: "192.168.1.0"

startingAddress

string

Starting IP address of the DHCP scope

Returned: always

Sample: "192.168.1.1"

subnetMask

string

Subnet mask for the DHCP scope

Returned: always

Sample: "255.255.255.0"

Authors

  • Frank Muise (@effectivelywild)