---
- name: Настроить NTP-сервер в timesyncd.conf
hosts: servers
become: true
tasks:
- name: Установить NTP=plasma.local в timesyncd.conf
ansible.builtin.lineinfile:
path: /etc/systemd/timesyncd.conf
regexp: '^\s*#?\s*NTP\s*='
line: 'NTP=plasma.local'
insertafter: '^\[Time\]'
state: present
notify: Перезапустить timesyncd
handlers:
- name: Перезапустить timesyncd
ansible.builtin.systemd:
name: systemd-timesyncd
state: restarted