File 0003-Distro-dependent-chrony-config-file.patch of Package cloud-init

From 42cb1841035befa5b5823b3321c8fe92f2cb9087 Mon Sep 17 00:00:00 2001
From: Robert Schweikert <rjschwei@suse.com>
Date: Mon, 18 Dec 2017 14:54:10 -0500
Subject: [PATCH 3/3] - Distro dependent chrony config file   + We all like to
 stor ethe drift file in different places and name it     differently :(

---
 cloudinit/config/cc_ntp.py                         |  8 +++++--
 ...{chrony.conf.tmpl => chrony.conf.opensuse.tmpl} |  0
 templates/chrony.conf.sles.tmpl                    | 25 ++++++++++++++++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)
 rename templates/{chrony.conf.tmpl => chrony.conf.opensuse.tmpl} (100%)
 create mode 100644 templates/chrony.conf.sles.tmpl

diff --git a/cloudinit/config/cc_ntp.py b/cloudinit/config/cc_ntp.py
index 2f662a9e..1db648bc 100644
--- a/cloudinit/config/cc_ntp.py
+++ b/cloudinit/config/cc_ntp.py
@@ -50,6 +50,7 @@ schema = {
     'examples': [
         dedent("""\
         ntp:
+          enabled: true
           pools: [0.int.pool.ntp.org, 1.int.pool.ntp.org, ntp.myorg.org]
           servers:
             - ntp.server.local
@@ -61,6 +62,9 @@ schema = {
         'ntp': {
             'type': ['object', 'null'],
             'properties': {
+                'enabled':  {
+                    "type": "boolean"
+                },
                 'pools': {
                     'type': 'array',
                     'items': {
@@ -109,7 +113,7 @@ def handle(name, cfg, cloud, log, _args):
     if not isinstance(ntp_cfg, (dict)):
         raise RuntimeError(("'ntp' key existed in config,"
                             " but not a dictionary type,"
-                            " is a %s %instead"), type_utils.obj_name(ntp_cfg))
+                            " is a %s instead"), type_utils.obj_name(ntp_cfg))
 
     if ntp_cfg.get('enabled') and ntp_cfg.get('enabled') == 'true':
         cloud.distro.set_timesync_client()
@@ -129,7 +133,7 @@ def handle(name, cfg, cloud, log, _args):
             template_name = 'timesyncd.conf'
         elif client_name == 'chrony':
             confpath = CHRONY_CONF_FILE
-            template_name = 'chrony.conf'
+            template_name = 'chrony.conf.%s' % cloud.distro.name
     else:
         if ntp_installable():
             service_name = 'ntp'
diff --git a/templates/chrony.conf.tmpl b/templates/chrony.conf.opensuse.tmpl
similarity index 100%
rename from templates/chrony.conf.tmpl
rename to templates/chrony.conf.opensuse.tmpl
diff --git a/templates/chrony.conf.sles.tmpl b/templates/chrony.conf.sles.tmpl
new file mode 100644
index 00000000..38e84d85
--- /dev/null
+++ b/templates/chrony.conf.sles.tmpl
@@ -0,0 +1,25 @@
+## template:jinja
+# cloud-init generated file
+# See chrony.conf(5)
+
+{% if pools %}# pools
+{% endif %}
+{% for pool in pools -%}
+pool {{pool}} iburst
+{% endfor %}
+{%- if servers %}# servers
+{% endif %}
+{% for server in servers -%}
+server {{server}} iburst
+{% endfor %}
+
+# Record the rate at which the the system clock gains/losses time
+driftfile /var/lib/chrony/drift
+
+# Allow the system clock to be stepped in the first three updates
+# if its offset is larger than 1 second.
+makestep 1.0 3
+
+# Enable kernel synchronization of the real-time clock (RTC).
+rtcsync
+
-- 
2.13.6