ans2dev.general.chrony_info module – Collect chrony information.
Note
This module is part of the ans2dev.general collection (version 0.2.0).
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 ans2dev.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: ans2dev.general.chrony_info
.
New in ans2dev.general 0.2.0
Synopsis
Retrieves
chrony
information usingchronyd
andchronyc
commands.Collects
configuration
,sources
,sourcestat
andntpdata
info based onmode
option.Pay attention to the requirements section before using this module.
Requirements
The below requirements are needed on the host that executes this module.
chronyd
command with-p
option.chronyc
command with-n
sources
,sourcestats
andntpdata
options.chronyd.service
must berunning
to usesources
,sourcestats
andntpdata
inmode
option.
Parameters
Parameter |
Comments |
---|---|
This option specifies which type of chrony data the module should collect.
Choices:
|
Notes
Note
Module requires
register
function in order to access to the collected info.Module commands require
chronyd.service
inrunning
state.
Examples
---
# Collect chronyd configuration
- name: Get chrony configuration info
ans2dev.general.chrony_info:
mode: conf
register: result
# Collect sources data
- name: Get chrony sources table
ans2dev.general.chrony_info:
mode: sources
register: result
# Collect sourcestats data
- name: Get chrony sourcestats table
ans2dev.general.chrony_info:
mode: sourcestats
register: result
# Collect all ntpdata information from all configured servers
- name: Get chrony ntpdata info for all servers
ans2dev.general.chrony_info:
mode: ntpdata
register: result
# Collect ntpdata only for a specific server
- name: Get chrony ntpdata info for a specific server
ans2dev.general.chrony_info:
mode: ntpdata
IP: "100.110.92.1"
register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Dictionary of Additional fields will be returned depending on configuration file. Returned: when |
|
This file stores the measured clock drift of the system.
Returned: if Sample: |
|
This file contains authentication keys. It helps secure NTP exchanges. Returned: if Sample: |
|
This setting specifies the time zone context used when applying leap second corrections. Returned: if Sample: |
|
This directory is where Returned: if Sample: |
|
The makestep directive controls when Returned: if Sample: |
|
This directory is used by Returned: if Sample: |
|
When set to true, this option instructs Returned: if Sample: |
|
This is a list of NTP servers chrony uses to obtain the correct time. The IP addresses are provided along with an additional option Depending on configuration it return Returned: if Sample: |
|
This directory contains additional configuration files or sources provided dynamically. Returned: if Sample: |
|
Dictionary of It is a complex dictionary that contains a dictionary for each configured IP. If Additional fields will be returned depending on Returned: when |
|
Indicates whether the NTP data received from the server is authenticated. Returned: always Sample: |
|
Shows whether the server is using interleaved from for packet exchange. Returned: always Sample: |
|
Represents the asymmetry in network jitter between transmit and receive paths. Returned: always Sample: |
|
Reports the leap second status. Returned: always Sample: |
|
Provides the local network address and additional numeric code that the system is using for communicating with the remote NTP server. Returned: always Sample: |
|
Indicates the NTP mode in which the server is operating. Returned: always Sample: |
|
Displays the results of various NTP internal tests. The string consists of multiple sets of digits, with each group representing a particular outcome test. Returned: always Sample: |
|
Reflects the measured time difference between the local system clock and the remote NTP server clock. Returned: always Sample: |
|
Measures the delay between the local system and the peer. Returned: always Sample: |
|
Represents the dispersion in delay measurements to the remote server. Returned: always Sample: |
|
Shows the polling interval used by Returned: always Sample: |
|
Indicates the precision of the system clock as measured by Returned: always Sample: |
|
Identifies the reference clock or time source that the server uses as its basis. Returned: always Sample: |
|
Shows the time at which the server last synchronized with its reference clock. Returned: always Sample: |
|
Displays the remote NTP server IP address along with an accompanying numeric code. Returned: always Sample: |
|
Indicates the network port number used by the remote NTP server for communication. Returned: always Sample: |
|
Captures the round-trip time from when a request was sent to the remote server and when the response was received. Returned: always Sample: |
|
Represents the total round-trip delay to the primary reference clock. Returned: always Sample: |
|
The dispersion associated with the root delay. Returned: always Sample: |
|
Specifies the method used for timestamping incoming received packets. Returned: always Sample: |
|
Denotes the stratum level of the server. Stratum 0 is reserved for high-precision timekeeping devices. Returned: always Sample: |
|
The number of received packets that passed internal validation checks. Returned: always Sample: |
|
Reflects the total count of received packets that were processed using hardware timestamping. Returned: always Sample: |
|
Indicates the total count of transmitted packets that were processed using hardware timestamping. Returned: always Sample: |
|
Represents the number of packets received at the kernel level. Returned: always Sample: |
|
Represents the number of packets transmitted at the kernel level. Returned: always Sample: |
|
The total number of packets received. Returned: always Sample: |
|
The total number of packets transmitted to the server. Returned: always Sample: |
|
The number of received packets that have been validated and considered correct by the NTP protocol criteria. Returned: always Sample: |
|
Indicates the method used for timestamping outgoing transmitted packets. Returned: always Sample: |
|
Denotes the NTP protocol version used in the communication. Returned: always Sample: |
|
Dictionary of Additional fields will be returned depending on Returned: when |
|
This column reports the most recent time measurement information received from the source. Returned: always Sample: |
|
This field indicates how long ago the last valid packet was received from the source. Returned: always Sample: |
|
This field contains a status indicator for the source. Returned: always Sample: |
|
This field contains the hostname or IP address of the NTP source. Returned: always Sample: |
|
This is the polling interval, expressed typically as a power-of-two exponent in seconds. Returned: always Sample: |
|
This represents the reachability register for the source. It is an 8-bit shift register that records the success or failure of recent attempts to contact the time server. Returned: always Sample: |
|
This field represents the stratum level of the NTP server. Returned: always Sample: |
|
Dictionary of Additional fields will be returned depending on Returned: when |
|
This value represents the variability or statistical dispersion of the measured frequency offsets. Returned: always Sample: |
|
Reflects the average frequency offset or error of the local clock relative to the reference provided by the source. It is expressed in a way that indicates how far off and in which direction the clock might be running. Returned: always Sample: |
|
The hostname or IP address of the NTP source from which measurements are taken. Returned: always Sample: |
|
Often represents the number of measurement samples or packets that have been successfully collected and used for statistical analysis. Returned: always Sample: |
|
Indicates the number of rejected measurements. Returned: always Sample: |
|
The average offset is the measured difference in time between the local system clock and the remote NTP source. Returned: always Sample: |
|
Represents the time span in seconds between the oldest and newest measurement sample used to compute the statistics. Returned: always Sample: |
|
This is the standard deviation of the offset measurements. The standard deviation gives a sense of the spread or dispersion of the offset values. Returned: always Sample: |