Kapisi/roles/ShadowArch/tasks/ntp.yml

41 lines
746 B
YAML
Raw Normal View History

2022-01-25 23:54:43 -06:00
---
- name: Set up time zone
become: yes
register: localtime
file:
src: "/usr/share/zoneinfo/{{ time_zone }}"
dest: /etc/localtime
state: link
- name: Remove legacy NTP services
become: yes
ignore_errors: yes
service:
2022-01-25 23:54:43 -06:00
name: "{{ item }}"
state: stopped
enabled: no
loop:
- ntpd
- openntpd
- name: Remove legacy NTP packages
become: yes
package:
name:
2022-01-25 23:54:43 -06:00
- ntp
- openntpd
state: absent
- name: Install NTP packages
become: yes
package:
2022-01-25 23:54:43 -06:00
name: chrony
state: present
- name: Start NTP service
become: yes
service:
name: chronyd
state: started
enabled: yes