effectivelywild.technitium_dns.technitium_dns_get_cluster_state module – Get DNS cluster state
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.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: effectivelywild.technitium_dns.technitium_dns_get_cluster_state.
New in effectivelywild.technitium_dns 1.0.0
Synopsis
Returns data on the current state of the DNS cluster.
Can be used to check if clustering is initialized and view cluster node information.
Optionally includes server IP addresses configured on the server.
Requirements
The below requirements are needed on the host that executes this module.
Technitium DNS Server v14.0 or later
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 |
|
Set to true to return a list of static IP addresses configured on the server. Choices:
|
|
The node domain name for which this API call is intended. When unspecified, the current node is used. |
|
Whether to validate SSL certificates when making API requests. Choices:
|
Notes
Note
This operation requires Administration View permission.
The node parameter can only be used when clustering is initialized.
See Also
See also
- effectivelywild.technitium_dns.technitium_dns_init_cluster
Initialize a new cluster
- effectivelywild.technitium_dns.technitium_dns_delete_cluster
Delete cluster configuration
Examples
- name: Get cluster state
effectivelywild.technitium_dns.technitium_dns_get_cluster_state:
api_url: "http://localhost"
api_token: "myapitoken"
register: result
- name: Display cluster state
debug:
var: result.cluster_state
- name: Check if cluster is initialized
effectivelywild.technitium_dns.technitium_dns_get_cluster_state:
api_url: "http://localhost"
api_token: "myapitoken"
register: result
- name: Fail if cluster is not initialized
fail:
msg: "Cluster is not initialized"
when: not result.cluster_state.clusterInitialized
- name: Get cluster state with server IP addresses
effectivelywild.technitium_dns.technitium_dns_get_cluster_state:
api_url: "http://localhost"
api_token: "myapitoken"
include_server_ip_addresses: true
register: result
- name: Display server IP addresses
debug:
var: result.cluster_state.serverIpAddresses
- name: Get cluster state for specific node
effectivelywild.technitium_dns.technitium_dns_get_cluster_state:
api_url: "http://localhost"
api_token: "myapitoken"
node: "server2.example.com"
register: result
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 get operations) Returned: always Sample: |
|
Complete cluster state information Returned: always |
|
The cluster domain name (only when initialized) Returned: when cluster is initialized Sample: |
|
Whether the cluster is initialized Returned: always Sample: |
|
List of nodes in the cluster (only when initialized) Returned: when cluster is initialized |
|
Node ID Returned: success Sample: |
|
Node IP address Returned: success Sample: |
|
Node domain name Returned: success Sample: |
|
Node state (Self, Connected, Unreachable) Returned: success Sample: |
|
Node type (Primary or Secondary) Returned: success Sample: |
|
Last seen timestamp Returned: success Sample: |
|
Node API URL Returned: success Sample: |
|
When the configuration was last synced (ISO 8601 format, only when initialized) Returned: when cluster is initialized Sample: |
|
Interval in seconds for config refresh (only when initialized) Returned: when cluster is initialized Sample: |
|
Interval in seconds for config retry (only when initialized) Returned: when cluster is initialized Sample: |
|
The DNS server domain name Returned: always Sample: |
|
Interval in seconds for heartbeat refresh (only when initialized) Returned: when cluster is initialized Sample: |
|
Interval in seconds for heartbeat retry (only when initialized) Returned: when cluster is initialized Sample: |
|
List of static IP addresses configured on the server (only when include_server_ip_addresses is true) Returned: when include_server_ip_addresses is true Sample: |
|
Technitium DNS Server version Returned: always Sample: |
|
Whether the module failed Returned: always Sample: |
|
Status message Returned: on error Sample: |