Skip to content

systemd-timesyncd

Creates a critical alert if a bootstrap Task failure occurs.

This task renders the Template defined by the Param systemd-timesyncd-template to the /etc/systemd/timesyncd.conf.d/ directory and then starts the time service.

This task can be disabled from running by setting the systemd-timesyncd-skip Param to true.

By default this task will render the default defined configuration file for systemd-timesyncd. To change the config file that is rendered, set the systemd-timesyncd-conf Param to either a filename (rendered in to /etc/systemd/timesyncd.conf.d/) or a fully qualified path/filename.

The default template is defined by the Param systemd-timesyncd-template. For more complex configuration changes beside a list of NTP Servers (defined by ntp-servers Param), create a new Template on the system with your needs, and define the name of the template in this Param.

If the ntp-servers Param is set, then the NTP= config directive will be used. If it is not set then the system will fall back to the FallbackNTP= directive using 0.pool.ntp.org, 1.pool.ntp.org, and 2.pool.ntp.org.

Last, if a TimeZone spec is defined in the timezone Param, then that will be set prior to (re)starting the systemd-timesyncd service. Note that the TimeZone spec must conform to the systemd defined TimeZone definitions. If this is defined wrong, the Task will fail and output the valid usable values. To derive these outside of the Task running, use the following command:

  • timedatectl --list-timezones

This Task will take efforts to validate that the host is a SystemD enable host, that the systemd-timesyncd Unit is available; and if not, attempt to package install the systemd-timesyncd package.

If any of the above tests fails, the task will exit with an error.

If the operator defines a fully qualified directory location, it is the responsibility of the operator to also ensure that systemd-timesyncd knows how to find the configuration file at that location. The default directory is /etc/systemd/timesyncd.conf.d/ and any file ending in *.conf will be parsed and processed for configuration files.