Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
puppet: Allow choice of timesync tool.
Alex Vandiver68f407187305
diff --git a/docs/production/deployment.md b/docs/production/deployment.mdindex 03cdf02166c..5dd910f6ad6 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 searchextension](../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.ppindex 5ba3a2171c7..06b973ba5d2 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::timesyncinclude zulip::commoncase $::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.ppnew file mode 100644index 00000000000..00f66ec52a7--- /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')+ }+ }+}