Project

General

Profile

Actions

Feature #24290

closed

Use chronyd instead of ntp in provisioning templates on RHEL systems

Added by Daniel Lobato Garcia over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Category:
TFTP
Target version:
-
Difficulty:
easy
Triaged:
Yes
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

Actions #1

Updated by Aditi Puntambekar over 5 years 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 ?

Actions #2

Updated by Aditi Puntambekar over 5 years ago

  • Assignee set to Aditi Puntambekar
Actions #3

Updated by Lukas Zapletal over 5 years 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

Actions #4

Updated by Aditi Puntambekar over 5 years 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 ?

Actions #5

Updated by Lukas Zapletal over 5 years 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.

Actions #6

Updated by Aditi Puntambekar over 5 years 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 ?

Actions #7

Updated by Lukas Zapletal over 5 years ago

  • Status changed from New to Closed
  • Assignee changed from Aditi Puntambekar to Stephen Benjamin
  • Difficulty set to easy
  • Triaged changed from No to Yes
  • 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.

Actions #8

Updated by Tomer Brisker over 5 years ago

  • Fixed in Releases 1.20.1, 1.21.0 added
Actions

Also available in: Atom PDF