.. _vyos.rest.vyos_ntp_global_module: ************************* vyos.rest.vyos_ntp_global ************************* **Manage NTP configuration on VyOS devices using REST API** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages NTP server, allow-client, and listen-address configuration on VyOS devices via the REST API. - Supports idempotent operation using structured data. - Uses REST API (``connection=httpapi``) instead of CLI. - Targets VyOS 1.4+ where NTP is managed by chronyd under ``service ntp``. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
NTP configuration.
allow_clients
list / elements=string
List of client networks or addresses allowed to query this NTP server.
Maps to service ntp allow-client address on the device.
listen_addresses
list / elements=string
Local IP addresses the NTP service should listen on.
Maps to service ntp listen-address on the device.
servers
list / elements=dictionary
List of upstream NTP servers to synchronise from.
options
list / elements=string
    Choices:
  • dynamic
  • noselect
  • pool
  • preempt
  • prefer
  • nts
  • ptp
  • interleave
Per-server options.
server
string / required
Server hostname or IP address.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
The desired state of the NTP configuration.

Examples -------- .. code-block:: yaml - name: Gather current NTP configuration vyos.rest.vyos_ntp_global: state: gathered - name: Merge NTP configuration vyos.rest.vyos_ntp_global: config: allow_clients: - 10.6.6.0/24 listen_addresses: - 10.1.3.1 servers: - server: 203.0.113.0 options: - prefer state: merged - name: Replace NTP configuration vyos.rest.vyos_ntp_global: config: allow_clients: - 10.6.6.0/24 listen_addresses: - 10.1.3.1 servers: - server: 203.0.113.0 options: - prefer state: replaced - name: Delete all managed NTP configuration vyos.rest.vyos_ntp_global: state: deleted Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
NTP configuration after this module ran.

before
dictionary
when state is merged, replaced, overridden or deleted
NTP configuration before this module ran.

commands
list
always
List of API commands sent to the device.

gathered
dictionary
when state is gathered
Current NTP configuration as structured data.

saved
boolean
when changed
Whether the config was saved after changes.



Status ------ Authors ~~~~~~~ - Varshitha Yataluru (@YVarshitha)