org.osbuild.chrony
Configure chrony to set system time from the network.
Configures chrony
by modifying /etc/chrony.conf
.
Before new values are added to the chrony configuration, all lines starting with
"server", "pool" or "peer" are removed.
The 'timeservers' option provides a very high-level way of configuring chronyd
with specific timeservers. Its value is a list of strings representing the
hostname or IP address of the timeserver. For each list item, the following
line will be added to the configuration:
server \<HOSTNAME/IP\> iburst
The 'servers' option provides a direct mapping to the server
directive from
chrony configuration. Its value is a list of dictionaries representing each
timeserver which should be added to the configuration. For each list item,
a server
directive will be added the configuration. Currently supported
subset of options which can be specified for each timeserver item:
- 'hostname' (REQUIRED)
- 'minpoll'
- 'maxpoll'
- 'iburst' (defaults to true)
- 'prefer' (defaults to false)
The
leapsectz
option configures chrony behavior related to automatic checking of the next occurrence of the leap second, using the provided timezone. Its value is a string representing a timezone from the system tz database (e.g. 'right/UTC'). If an empty string is provided, then all occurrences ofleapsectz
directive are removed from the configuration. Constraints: - Exactly one of 'timeservers' or 'servers' options must be provided.
Schema 1
{
"additionalProperties": false,
"oneOf": [
{
"required": [
"timeservers"
]
},
{
"required": [
"servers"
]
}
],
"properties": {
"timeservers": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of NTP server addresses."
},
"servers": {
"type": "array",
"items": {
"additionalProperties": false,
"type": "object",
"required": [
"hostname"
],
"properties": {
"hostname": {
"type": "string",
"description": "Hostname or IP address of a NTP server."
},
"minpoll": {
"type": "integer",
"description": "Specifies the minimum interval between requests sent to the server as a power of 2 in seconds.",
"minimum": -6,
"maximum": 24
},
"maxpoll": {
"type": "integer",
"description": "Specifies the maximum interval between requests sent to the server as a power of 2 in seconds.",
"minimum": -6,
"maximum": 24
},
"iburst": {
"type": "boolean",
"default": true,
"description": "Configures chronyd behavior related to burst requests on startup."
},
"prefer": {
"type": "boolean",
"default": false,
"description": "Prefer this source over sources without the prefer option."
}
}
}
},
"leapsectz": {
"type": "string",
"description": "Timezone used by chronyd to determine when will the next leap second occur. Empty value will remove the option."
}
}
}
Schema 2
{}