This commit is contained in:
parent
b1228ae022
commit
5c6cf6764e
@ -7,7 +7,7 @@ chrony_conf_file: /etc/chrony/chrony.conf
|
|||||||
chrony_key_file: /etc/chrony/chrony.keys
|
chrony_key_file: /etc/chrony/chrony.keys
|
||||||
chrony_drift_file: /var/lib/chrony/drift
|
chrony_drift_file: /var/lib/chrony/drift
|
||||||
|
|
||||||
# chrony_pool: $ "_unset_"
|
# @var chrony_pool:default: $ "_unset_"
|
||||||
chrony_server: "169.254.169.123 prefer iburst"
|
chrony_server: "169.254.169.123 prefer iburst"
|
||||||
|
|
||||||
chrony_log: "tracking measurements statistics"
|
chrony_log: "tracking measurements statistics"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Restart service
|
- name: Restart service
|
||||||
systemd:
|
systemd:
|
||||||
name: chrony.service
|
name: chronyd.service
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: True
|
daemon_reload: True
|
||||||
enabled: True
|
enabled: True
|
||||||
|
@ -8,9 +8,6 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
|
|||||||
|
|
||||||
|
|
||||||
def test_chrony_running_and_enabled(host):
|
def test_chrony_running_and_enabled(host):
|
||||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user is-enabled chrony.service"
|
chrony = host.service("chronyd")
|
||||||
|
assert chrony.is_running
|
||||||
with host.sudo(user="chrony"):
|
assert chrony.is_enabled
|
||||||
status = host.check_output(command)
|
|
||||||
|
|
||||||
assert status == "enabled"
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
template:
|
template:
|
||||||
src: etc/chrony.conf.j2
|
src: etc/chrony.conf.j2
|
||||||
dest: /etc/chrony.conf
|
dest: /etc/chrony.conf
|
||||||
|
mode: 0644
|
||||||
notify: __chrony_restart
|
notify: __chrony_restart
|
||||||
|
|
||||||
- name: Ensure service is up and running
|
- name: Ensure service is up and running
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
port {{ chrony_port }}
|
port {{ chrony_port }}
|
||||||
acquisitionport {{ chrony_acquisitionport }}
|
acquisitionport {{ chrony_acquisitionport }}
|
||||||
|
{% if chrony_pool is defined %}
|
||||||
pool {{ chrony_pool }}
|
pool {{ chrony_pool }}
|
||||||
|
{% endif %}
|
||||||
server {{ chrony_server }}
|
server {{ chrony_server }}
|
||||||
|
|
||||||
keyfile {{ chrony_key_file }}
|
keyfile {{ chrony_key_file }}
|
||||||
@ -13,44 +15,19 @@ log {{ chrony_log }}
|
|||||||
logdir {{ chrony_log_dir }}
|
logdir {{ chrony_log_dir }}
|
||||||
maxupdateskew {{ chrony_maxupdateskew }}
|
maxupdateskew {{ chrony_maxupdateskew }}
|
||||||
dumponexit
|
dumponexit
|
||||||
# Specify directory for dumping measurements.
|
|
||||||
|
|
||||||
|
|
||||||
dumpdir {{ chrony_dump_dir }}
|
dumpdir {{ chrony_dump_dir }}
|
||||||
{% if chrony_initstepslew_enabled | bool %}
|
{% if chrony_initstepslew_enabled | bool %}
|
||||||
initstepslew {{ chrony_initstepslew_threshold }} {{ chrony_initstepslew_servers }}
|
initstepslew {{ chrony_initstepslew_threshold }} {{ chrony_initstepslew_servers }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# This directive lets 'chronyd' to serve time even if unsynchronised to any
|
|
||||||
# NTP server.
|
|
||||||
|
|
||||||
#local stratum 10
|
|
||||||
|
|
||||||
{% if chrony_allow | length > 0 %}
|
{% if chrony_allow | length > 0 %}
|
||||||
# This directive designates subnets (or nodes) from which NTP clients are allowed
|
|
||||||
# to access to 'chronyd'.
|
|
||||||
{% for block in chrony_allow %}
|
{% for block in chrony_allow %}
|
||||||
allow {{ block }}
|
allow {{ block }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# This directive forces `chronyd' to send a message to syslog if it
|
|
||||||
# makes a system clock adjustment larger than a threshold value in seconds.
|
|
||||||
|
|
||||||
logchange 0.5
|
logchange 0.5
|
||||||
|
|
||||||
# This directive defines an email address to which mail should be sent
|
|
||||||
# if chronyd applies a correction exceeding a particular threshold to the
|
|
||||||
# system clock.
|
|
||||||
|
|
||||||
# mailonchange root@localhost 0.5
|
|
||||||
|
|
||||||
# This directive tells 'chronyd' to parse the 'adjtime' file to find out if the
|
|
||||||
# real-time clock keeps local time or UTC. It overrides the 'rtconutc' directive.
|
|
||||||
|
|
||||||
hwclockfile /etc/adjtime
|
hwclockfile /etc/adjtime
|
||||||
|
|
||||||
# This directive enables kernel synchronisation (every 11 minutes) of the
|
|
||||||
# real-time clock. Note that it can't be used along with the 'rtcfile' directive.
|
|
||||||
|
|
||||||
rtcsync
|
rtcsync
|
||||||
|
Loading…
Reference in New Issue
Block a user