switched ntp client to chrony
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# FILE: roles/common/handlers/main.yml
|
# FILE: roles/common/handlers/main.yml
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
- name: restart timesyncd
|
- name: restart chrony
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-timesyncd
|
name: chrony
|
||||||
state: restarted
|
state: restarted
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
common_timezone: America/Chicago
|
common_timezone: America/Chicago
|
||||||
|
|
||||||
common_ntp_server: 10.1.71.33 # sundial
|
common_ntp_server: sundial.local.mk-labs.cloud
|
||||||
|
|
||||||
common_packages:
|
common_packages:
|
||||||
- curl
|
- curl
|
||||||
|
|||||||
@@ -23,16 +23,21 @@
|
|||||||
name: "{{ common_packages }}"
|
name: "{{ common_packages }}"
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Configure NTP to use sundial
|
- name: Install chrony
|
||||||
template:
|
apt:
|
||||||
src: timesyncd.conf.j2
|
name: chrony
|
||||||
dest: /etc/systemd/timesyncd.conf
|
state: present
|
||||||
mode: '0644'
|
|
||||||
notify: restart timesyncd
|
|
||||||
|
|
||||||
- name: Ensure systemd-timesyncd is enabled and running
|
- name: Configure chrony to use sundial
|
||||||
|
template:
|
||||||
|
src: chrony.conf.j2
|
||||||
|
dest: /etc/chrony/chrony.conf
|
||||||
|
mode: '0644'
|
||||||
|
notify: restart chrony
|
||||||
|
|
||||||
|
- name: Ensure chrony is enabled and running
|
||||||
systemd:
|
systemd:
|
||||||
name: systemd-timesyncd
|
name: chrony
|
||||||
state: started
|
state: started
|
||||||
enabled: yes
|
enabled: yes
|
||||||
|
|
||||||
|
|||||||
5
ansible/playbooks/roles/common/templates/chrony.conf.j2
Normal file
5
ansible/playbooks/roles/common/templates/chrony.conf.j2
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Managed by Ansible — do not edit manually
|
||||||
|
server {{ common_ntp_server }} iburst
|
||||||
|
driftfile /var/lib/chrony/chrony.drift
|
||||||
|
makestep 1.0 3
|
||||||
|
rtcsync
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Managed by Ansible — do not edit manually
|
|
||||||
[Time]
|
|
||||||
NTP={{ common_ntp_server }}
|
|
||||||
FallbackNTP=ntp.ubuntu.com
|
|
||||||
Reference in New Issue
Block a user