summaryrefslogtreecommitdiff
path: root/roles/core/ntp/templates/openntpd.conf.j2
diff options
context:
space:
mode:
Diffstat (limited to 'roles/core/ntp/templates/openntpd.conf.j2')
-rw-r--r--roles/core/ntp/templates/openntpd.conf.j220
1 files changed, 20 insertions, 0 deletions
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 %}