cookbook 'systemd_timesyncd', '~> 0.3.1'
systemd_timesyncd (2) Versions 0.3.1 Follow0
Installs/Configures systemd-timesyncd
cookbook 'systemd_timesyncd', '~> 0.3.1', :supermarket
knife supermarket install systemd_timesyncd
knife supermarket download systemd_timesyncd
systemd_timesyncd Cookbook
systemd-timesyncd is a service that has been added to systemd
for synchronizing the system clock across the network with a remote Network Time Protocol server and is included in most recent Linux distributions. Similar to ntpd
or chrony
yet simpler in the implementation, it is considered sufficient for most Linux machines' time synchronization requirements.
Supported Platforms
Full support for systemd-timesyncd
varies by Linux distribution versions. Red Hat has chosen not to ship it in favor of chrony
.
Distribution Version | Supported |
---|---|
Amazon Linux 2.0 | no |
CentOS/Red Hat 6 | no |
CentOS/Red Hat 7 | no |
CentOS/Red Hat 8 | no |
Debian 8 | yes |
Debian 9 | yes |
Debian 10 | yes |
SUSE Enterprise Linux Server 15 | yes |
Ubuntu 16.04 | yes |
Ubuntu 18.04 | yes |
Ubuntu 20.04 | yes |
Custom Resource
This resource will write out a /etc/systemd/timesyncd.conf
for configuration and supports the actions enable
and start
the systemd-timesyncd.service
.
systemd_timesyncd 'Configure systemd_timesyncd as a client' do
ntp ['10.0.0.1']
fallbackntp ['0.arch.pool.ntp.org','1.arch.pool.ntp.org']
action [:enable, :start]
end
Properties
The properties map to the options listed in the timesyncd.conf documentation.
-
ntp
: A space-separated list of NTP server host names or IP addresses. During runtime this list is combined with any per-interface NTP servers acquired from systemd-networkd.service. systemd-timesyncd will contact all configured system or per-interface servers in turn until one is found that responds. When the empty string is assigned, the list of NTP servers is reset, and all assignments prior to this one will have no effect. This setting defaults to an empty list. -
fallbackntp
: A space-separated list of NTP server host names or IP addresses. During runtime this list is combined with any per-interface NTP servers acquired from systemd-networkd.service. systemd-timesyncd will contact all configured system or per-interface servers in turn until one is found that responds. When the empty string is assigned, the list of NTP servers is reset, and all assignments prior to this one will have no effect. This setting defaults to an empty list. -
rootdistancemaxsec
: Maximum acceptable root distance. Takes a time value (in seconds). Defaults to 5 seconds. -
pollintervalminsec
,pollintervalmaxsec
: The minimum and maximum poll intervals for NTP messages. Each setting takes a time value (in seconds). PollIntervalMinSec= must not be smaller than 16 seconds. PollIntervalMaxSec= must be larger than PollIntervalMinSec=. PollIntervalMinSec= defaults to 32 seconds, and PollIntervalMaxSec= defaults to 2048 seconds.
Actions
:disable
: Disable the systemd-timesyncd
service.
:enable
: Enable the systemd-timesyncd
service at boot.
:restart
: Restart the systemd-timesyncd
service.
:start
: Start the systemd-timesyncd
service, and keep it running until stopped or disabled.
:stop
: Stop the systemd-timesyncd
service.
Default Recipe
The default recipe simply calls the custom resource with :enable
and :start
, passing the node attributes.
Attributes
The [attributes](attributes/default.rb) file provided defaults that map to the defaults provided by the timesyncd.conf documentation.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.3.1 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.3.1 passed this metric
No Binaries Metric
0.3.1 passed this metric
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.3.1 failed this metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.3.1 passed this metric
No Binaries Metric
0.3.1 passed this metric
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.3.1 passed this metric
0.3.1 passed this metric
Testing File Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.3.1 failed this metric
0.3.1 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number