summaryrefslogtreecommitdiff
path: root/roles/core/ntp/templates
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-11-27 23:26:04 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-11-28 00:52:04 +0100
commit221413244a408cfe27c894a8aef4c68a38348b43 (patch)
treea4eb0760f37e2910e40b13173f2e611bbd0ae9b4 /roles/core/ntp/templates
parentmove chrony role to core/ntp (WIP) (diff)
core/ntp role add systemd-timesyncd and openntpd
Diffstat (limited to 'roles/core/ntp/templates')
-rw-r--r--roles/core/ntp/templates/chrony.conf.j24
-rw-r--r--roles/core/ntp/templates/openntpd.conf.j220
2 files changed, 22 insertions, 2 deletions
diff --git a/roles/core/ntp/templates/chrony.conf.j2 b/roles/core/ntp/templates/chrony.conf.j2
index 0bad9235..e404da18 100644
--- a/roles/core/ntp/templates/chrony.conf.j2
+++ b/roles/core/ntp/templates/chrony.conf.j2
@@ -47,10 +47,10 @@ allow {{ rule }}
{% for rule in ntp_server.deny | default([]) %}
deny {{ rule }}
{% endfor %}
-{% if 'bindaddress' in ntp_server %}
+{% if 'bind' in ntp_server %}
bindaddress {{ ntp_server.bind }}
{% endif %}
{% if 'port' in ntp_server %}
- port {{ ntp_server.port }}
+port {{ ntp_server.port }}
{% endif %}
{% endif %}
diff --git a/roles/core/ntp/templates/openntpd.conf.j2 b/roles/core/ntp/templates/openntpd.conf.j2
new file mode 100644
index 00000000..09a6a9c3
--- /dev/null
+++ b/roles/core/ntp/templates/openntpd.conf.j2
@@ -0,0 +1,20 @@
+### Client
+{% if 'servers' in ntp_client %}
+
+{% for server in ntp_client.servers %}
+server {{ server.name }}{% if 'options' in server %} {{ server.options }}{% endif %}{{ '' }}
+{% endfor %}
+{% endif %}
+{% if 'pools' in ntp_client %}
+
+{% for pool in ntp_client.pools %}
+servers {{ pool.name }}{% if 'options' in pool %} {{ pool.options }}{% endif %}{{ '' }}
+{% endfor %}
+{% endif %}
+{% if ntp_server is defined %}
+
+
+### Server
+
+listen on {{ ntp_server.bind | default('*') }}
+{% endif %}