diff options
Diffstat (limited to 'roles/core/ntp/templates/chrony.conf.j2')
-rw-r--r-- | roles/core/ntp/templates/chrony.conf.j2 | 56 |
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..0bad9235 --- /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 'bindaddress' in ntp_server %} +bindaddress {{ ntp_server.bind }} +{% endif %} +{% if 'port' in ntp_server %} + port {{ ntp_server.port }} +{% endif %} +{% endif %} |