Skip to main content

NTP

The behaviors that ntp calls, and each call that its examples make. osapi dsl chain get --name ntp shows the same.

Chain​

Behaviorntp
Chainntp → managedfile
Callsmanagedfile
Used bynone

Set two servers (create)​

CALLSENDSGETS
ntp createservers=[0.pool.ntp.org, 1.pool.ntp.org]changed=true
└─ managedfile updatecontent=<2 lines> path=/etc/chrony/sources.d/osapi-ntp.sources secret…changed=true path=/etc/chrony/sources.d/osapi-ntp.sources

The servers that the host has (create)​

CALLSENDSGETS
ntp createservers=[0.pool.ntp.org]changed=false
└─ managedfile updatecontent="server 0.pool.ntp.org iburst\n" path=/etc/chrony/sources.d/o…changed=false path=/etc/chrony/sources.d/osapi-ntp.sources

Replace the servers (update)​

CALLSENDSGETS
ntp updateservers=[time.cloudflare.com]changed=true
└─ managedfile getpath=/etc/chrony/sources.d/osapi-ntp.sourcespath=/etc/chrony/sources.d/osapi-ntp.sources sha256=31520593e9ed4e5bb…
└─ managedfile updatecontent="server time.cloudflare.com iburst\n" path=/etc/chrony/source…changed=true path=/etc/chrony/sources.d/osapi-ntp.sources

The servers that the file has (update)​

CALLSENDSGETS
ntp updateservers=[0.pool.ntp.org]changed=false
└─ managedfile getpath=/etc/chrony/sources.d/osapi-ntp.sourcespath=/etc/chrony/sources.d/osapi-ntp.sources sha256=31520593e9ed4e5bb…
└─ managedfile updatecontent="server 0.pool.ntp.org iburst\n" path=/etc/chrony/sources.d/o…changed=false path=/etc/chrony/sources.d/osapi-ntp.sources

Remove the servers (delete)​

CALLSENDSGETS
ntp deletechanged=true
└─ managedfile deletepath=/etc/chrony/sources.d/osapi-ntp.sourceschanged=true path=/etc/chrony/sources.d/osapi-ntp.sources

When osapi set no servers (delete)​

CALLSENDSGETS
ntp deletechanged=false
└─ managedfile deletepath=/etc/chrony/sources.d/osapi-ntp.sourceschanged=false path=/etc/chrony/sources.d/osapi-ntp.sources