.. _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.
running_config
string
Used only with state parsed.
Provide the output of show configuration commands | grep ntp.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
  • rendered
  • parsed
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.

parsed
dictionary
when state is parsed
Structured data parsed from running_config.

rendered
list
when state is rendered
CLI commands generated for the provided config (offline).

saved
boolean
when changes are applied
Whether the config was saved after changes.



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