21 lines
610 B
YAML
21 lines
610 B
YAML
|
---
|
||
|
- hosts: all
|
||
|
|
||
|
vars:
|
||
|
chrony_pools: [0.de.pool.ntp.org, 1.de.pool.ntp.org, 2.de.pool.ntp.org]
|
||
|
|
||
|
tasks:
|
||
|
|
||
|
- name: Install Chrony
|
||
|
ansible.builtin.package: name=chrony state=latest
|
||
|
|
||
|
- name: Template config file
|
||
|
ansible.builtin.template: "src=chrony.conf.j2 dest='{{ chrony_config_path }}' mode=0644 owner=root group=root backup=yes"
|
||
|
|
||
|
- name: Restart Chrony with new config
|
||
|
ansible.builtin.service: "name='{{ chrony_service_name }}' state=restarted"
|
||
|
|
||
|
- name: Enable Chrony at boot
|
||
|
ansible.builtin.service: "name={{ chrony_service_name }} state=started enabled=yes"
|
||
|
|