Project

General

Profile

Feature #24290

Use chronyd instead of ntp in provisioning templates on RHEL systems

Added by Daniel Lobato Garcia over 1 year ago. Updated 12 months ago.

Status:
Closed
Priority:
Normal
Category:
TFTP
Target version:
-
Difficulty:
easy
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1601602

Description of problem: In the current default provisioning templates there is a step to do an initial time sync using ntpdate:

```
#update local time
echo "updating system time"
/usr/sbin/ntpdate -sub <%= host_param('ntp-server') || '0.fedora.pool.ntp.org' %>
/usr/sbin/hwclock --systohc
```

In order for this to work the ntp package is also installed in the %packages system since is not install in rhel by default.

From my understanding this line is just to do a quick initial sync. chronyd has an option to do this [1].

Most of our docs are (or are being updated to) prefer chrony [2].

So rather then install the ntp package to just use ntpdate once, we should probably consider using the 'chronyd -q' option.

[1] https://chrony.tuxfamily.org/faq.html#_does_code_chronyd_code_have_an_ntpdate_mode
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1589712

History

#1 Updated by Aditi Puntambekar about 1 year ago

  • Subject changed from Use chronyd instead of ntp in provisioning templates on RHEL systems to Use chronyd instead of ntp in provisioning templates on RHEL systems

Hello, are we planning to implement this feature by introducing chronyd ?

#2 Updated by Aditi Puntambekar about 1 year ago

  • Assignee set to Aditi Puntambekar

#3 Updated by Lukas Zapletal about 1 year ago

I don't agree with a simple replacement, there are features which are better in chrony and feature better in the original ntpd. They are both available on most systems, including RHEL7, we should have templates with both and let user to decide.

https://access.redhat.com/solutions/2070363

#4 Updated by Aditi Puntambekar about 1 year ago

Lukas Zapletal wrote:

I don't agree with a simple replacement, there are features which are better in chrony and feature better in the original ntpd. They are both available on most systems, including RHEL7, we should have templates with both and let user to decide.

https://access.redhat.com/solutions/2070363

So, should we install chrony and ntp both ? Also, how should chrony -q be then used along with ntpdate ?

#5 Updated by Lukas Zapletal about 1 year ago

We should default to chrony but when there is host parameter passed ntp-service and set to "ntpd" then we should use ntpd. Something like that IMHO.

#6 Updated by Aditi Puntambekar about 1 year ago

So does this mean if a host parameter say, ntp-service: string (default="ntpd") is passed, it should use ntpd, right? But, since this is already set to ntpd then how will it default to chrony ?

#7 Updated by Lukas Zapletal about 1 year ago

  • Triaged changed from No to Yes
  • Difficulty set to easy
  • Assignee changed from Aditi Puntambekar to Stephen Benjamin
  • Status changed from New to Closed
  • Pull request https://github.com/theforeman/community-templates/pull/530 added

This patch https://github.com/theforeman/community-templates/pull/530 introduced new option:

use_ntp = host_param_true?('use-ntp') || (is_fedora && os_major < 16) || (rhel_compatible && os_major <= 7)

Our templates are now compatible with boths, default to chrony on modern systems. This is overrideable via use-ntp option.

#8 Updated by Tomer Brisker 12 months ago

  • Fixed in Releases 1.20.1, 1.21.0 added

Also available in: Atom PDF