effectivelywild.technitium_dns.technitium_dns_list_dhcp_leases module – List all DHCP leases
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_leases.
New in effectivelywild.technitium_dns 0.6.0
Synopsis
Retrieve a list of all DHCP leases.
Lists both dynamic and reserved leases across all scopes.
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 validate SSL certificates when making API requests Choices:
|
See Also
See also
- effectivelywild.technitium_dns.technitium_dns_add_reserved_lease
Add a reserved DHCP lease to a scope
- effectivelywild.technitium_dns.technitium_dns_remove_reserved_lease
Remove a reserved DHCP lease from a scope
- effectivelywild.technitium_dns.technitium_dns_convert_to_reserved_lease
Convert a dynamic DHCP lease to a reserved lease
- effectivelywild.technitium_dns.technitium_dns_convert_to_dynamic_lease
Convert a reserved DHCP lease to a dynamic lease
- effectivelywild.technitium_dns.technitium_dns_remove_dhcp_lease
Remove a DHCP lease
Examples
- name: List all DHCP leases
technitium_dns_list_dhcp_leases:
api_url: "http://localhost"
api_token: "myapitoken"
register: result
- debug:
var: result.leases
- name: Find leases for a specific MAC address
technitium_dns_list_dhcp_leases:
api_url: "http://localhost"
api_token: "myapitoken"
register: leases_result
- name: Filter for specific MAC
set_fact:
my_lease: "{{ leases_result.leases | selectattr('hardwareAddress', 'equalto', '00-11-22-33-44-55') | list }}"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Whether the module made changes (always false for list operations) Returned: always Sample: |
|
Whether the module failed Returned: always Sample: |
|
List of DHCP leases from the Technitium DNS server Returned: always |
|
Leased IP address Returned: always Sample: |
|
DHCP client identifier Returned: always Sample: |
|
MAC address of the client Returned: always Sample: |
|
Hostname of the client Returned: when available Sample: |
|
Timestamp when lease expires Returned: always Sample: |
|
Timestamp when lease was obtained Returned: always Sample: |
|
Name of the DHCP scope this lease belongs to Returned: always Sample: |
|
Type of lease (Dynamic or Reserved) Returned: always Sample: |