first commit
This commit is contained in:
27
serv-01-baselinux/tasks/ntp2.yml
Normal file
27
serv-01-baselinux/tasks/ntp2.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
- name: Set timezone to Africa/Johannesburg
|
||||
community.general.timezone:
|
||||
name: Africa/Johannesburg
|
||||
|
||||
- name: Use fallback NTP servers
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
regexp: '^#?FallbackNTP='
|
||||
line: FallbackNTP=0.debian.pool.ntp.org 1.debian.pool.ntp.org 2.debian.pool.ntp.org 3.debian.pool.ntp.org
|
||||
owner: root
|
||||
group: root
|
||||
mode: '0644'
|
||||
|
||||
- name: Insert NTP line before FallbackNTP in timesyncd.conf
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
line: "NTP=time.ikeja.co.za"
|
||||
insertbefore: '^FallbackNTP'
|
||||
state: present
|
||||
|
||||
|
||||
- name: Restart and enable systemd-timesyncd
|
||||
ansible.builtin.service:
|
||||
name: systemd-timesyncd
|
||||
state: restarted
|
||||
enabled: true
|
||||
Reference in New Issue
Block a user