summaryrefslogtreecommitdiff
path: root/roles/core/ntp/templates/chrony.conf.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-11-28 00:57:39 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-11-28 00:57:39 +0100
commit638189b7050d25fce30bf3f7d7c9ac6bafa8a760 (patch)
tree7dc42fc9049823a468e8f0163c419ace7041b201 /roles/core/ntp/templates/chrony.conf.j2
parentkubernetes/standalone: fix config hash annotation if role is included multipl... (diff)
parentcore/ntp: add support for openbsd (diff)
Merge branch 'topic/core-ntp'
Diffstat (limited to 'roles/core/ntp/templates/chrony.conf.j2')
-rw-r--r--roles/core/ntp/templates/chrony.conf.j256
1 files changed, 56 insertions, 0 deletions
diff --git a/roles/core/ntp/templates/chrony.conf.j2 b/roles/core/ntp/templates/chrony.conf.j2
new file mode 100644
index 00000000..e404da18
--- /dev/null
+++ b/roles/core/ntp/templates/chrony.conf.j2
@@ -0,0 +1,56 @@
+### Global options
+
+cmdport 0
+keyfile /etc/chrony/chrony.keys
+driftfile /var/lib/chrony/chrony.drift
+logdir /var/log/chrony
+maxupdateskew 100.0
+rtcsync
+makestep 1 3
+{% if ntp_hwtimestamp_interfaces is defined %}
+
+{% for interface in ntp_hwtimestamp_interfaces %}
+hwtimestamp {{ interface.name }}{% if 'options' in interface %} {{ interface.options }}{% endif %}{{ '' }}
+{% endfor %}
+{% endif %}
+{% if ntp_client is defined %}
+
+
+### 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 %}
+pool {{ pool.name }}{% if 'options' in pool %} {{ pool.options }}{% endif %}{{ '' }}
+{% endfor %}
+{% endif %}
+{% if 'peers' in ntp_client %}
+
+{% for peer in ntp_client.peers %}
+peer {{ peer.name }}{% if 'options' in peer %} {{ peer.options }}{% endif %}{{ '' }}
+{% endfor %}
+{% endif %}
+{% endif %}
+{% if ntp_server is defined %}
+
+
+### Server
+
+{% for rule in ntp_server.allow | default([]) %}
+allow {{ rule }}
+{% endfor %}
+{% for rule in ntp_server.deny | default([]) %}
+deny {{ rule }}
+{% endfor %}
+{% if 'bind' in ntp_server %}
+bindaddress {{ ntp_server.bind }}
+{% endif %}
+{% if 'port' in ntp_server %}
+port {{ ntp_server.port }}
+{% endif %}
+{% endif %}