diff --git a/docs/production/deployment.md b/docs/production/deployment.md index 03cdf02166..5dd910f6ad 100644 --- a/docs/production/deployment.md +++ b/docs/production/deployment.md @@ -625,6 +625,14 @@ you will need to add **`zulip::apache_sso`** to the list. Set to true if enabling the [multi-language PGroonga search extension](../subsystems/full-text-search.md#multi-language-full-text-search). +#### `timesync` + +What time synchronization daemon to use; defaults to `chrony`, but also supports +`ntpd` and `none`. Installations should not adjust this unless they are aligning +with a fleet-wide standard of `ntpd`. `none` is only reasonable in containers +like LXC which do not allow adjustment of the clock; a Zulip server will not +function correctly without an accurate clock. + ### `[deployment]` #### `deploy_options` diff --git a/puppet/zulip/manifests/profile/base.pp b/puppet/zulip/manifests/profile/base.pp index 5ba3a2171c..06b973ba5d 100644 --- a/puppet/zulip/manifests/profile/base.pp +++ b/puppet/zulip/manifests/profile/base.pp @@ -3,6 +3,7 @@ # This class should only be included by classes that are intended to # be able to be deployed on their own host. class zulip::profile::base { + include zulip::timesync include zulip::common case $::os['family'] { 'Debian': { @@ -28,8 +29,6 @@ class zulip::profile::base { 'procps', # Used to read /etc/zulip/zulip.conf for `zulipconf` Puppet function 'crudini', - # Accurate time is essential - 'chrony', # Used for tools like sponge 'moreutils', # Nagios monitoring plugins @@ -49,7 +48,6 @@ class zulip::profile::base { 'curl', 'jq', 'crudini', - 'chrony', 'moreutils', 'nmap-ncat', 'nagios-plugins', # there is no dummy package on CentOS 7 @@ -60,8 +58,6 @@ class zulip::profile::base { fail('osfamily not supported') } } - package { 'ntp': ensure => purged, before => Package['chrony'] } - service { 'chrony': require => Package['chrony'] } package { $base_packages: ensure => installed } group { 'zulip': diff --git a/puppet/zulip/manifests/timesync.pp b/puppet/zulip/manifests/timesync.pp new file mode 100644 index 0000000000..00f66ec52a --- /dev/null +++ b/puppet/zulip/manifests/timesync.pp @@ -0,0 +1,23 @@ +# @summary Allows configuration of timesync tool. +class zulip::timesync { + $timesync = zulipconf('machine', 'timesync', 'chrony') + + case $timesync { + 'chrony': { + package { 'ntp': ensure => purged, before => Package['chrony'] } + package { 'chrony': ensure => installed } + service { 'chrony': require => Package['chrony'] } + } + 'ntpd': { + package { 'chrony': ensure => purged, before => Package['ntp'] } + package { 'ntp': ensure => installed } + service { 'ntp': require => Package['ntp'] } + } + 'none': { + package { ['ntp', 'chrony']: ensure => purged } + } + default: { + fail('Unknown timesync tool: $timesync') + } + } +}