35 lines
814 B
YAML
35 lines
814 B
YAML
|
---
|
||
|
- name: install chrony packages
|
||
|
become: yes
|
||
|
ansible.builtin.package:
|
||
|
name:
|
||
|
- chrony
|
||
|
state: present
|
||
|
|
||
|
- name: copy chrony config
|
||
|
become: yes
|
||
|
ansible.builtin.template:
|
||
|
src: chrony.conf.j2
|
||
|
dest: /etc/chrony/chrony.conf
|
||
|
notify: restart_chrony
|
||
|
|
||
|
- name: copy logrotate config
|
||
|
become: yes
|
||
|
ansible.builtin.template:
|
||
|
src: logrotate_chrony
|
||
|
dest: /etc/logrotate.d/chrony
|
||
|
|
||
|
- name: Create chrony driftfile folder
|
||
|
become: yes
|
||
|
file:
|
||
|
state: directory
|
||
|
path: "{{ ntp_chrony_driftfile_directory }}"
|
||
|
mode: 0644
|
||
|
owner: "{{ ntp_chrony_user }}"
|
||
|
group: "{{ ntp_chrony_group }}"
|
||
|
|
||
|
- name: set timezone to {{ ntp_chrony_timezone }}
|
||
|
become: yes
|
||
|
ansible.builtin.timezone:
|
||
|
name: "{{ ntp_chrony_timezone }}"
|