Init.
This commit is contained in:
20
tasks/main.yml
Normal file
20
tasks/main.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
# tasks file for systemd-timesyncd
|
||||
- block:
|
||||
- name: "set timezone"
|
||||
community.general.timezone:
|
||||
name: "{{ timezone }}"
|
||||
- name: "configure systemd-timesyncd"
|
||||
lineinfile:
|
||||
path: /etc/systemd/timesyncd.conf
|
||||
regexp: '{{ item.regexp }}'
|
||||
line: '{{ item.line }}'
|
||||
loop:
|
||||
- { 'regexp': '^#*NTP=.*$', 'line': 'NTP={{ ntp | default("") | join(" ") }}'}
|
||||
- { 'regexp': '^#*FallbackNTP=.*$', 'line': 'FallbackNTP={{ fallback_ntp | default("") | join(" ") }}'}
|
||||
- name: "start and enable systemd-timesyncd"
|
||||
service:
|
||||
name: systemd-timesyncd.service
|
||||
enabled: yes
|
||||
state: started
|
||||
notify: systemd-timesyncd configuration changed
|
||||
Reference in New Issue
Block a user