update ntp client
This commit is contained in:
parent
30e467b72e
commit
352985c483
|
@ -1,5 +1,5 @@
|
||||||
# restart crontab service to apply changes
|
# restart crontab service to apply changes
|
||||||
- name: restart crontab hourly
|
- name: restart systemd-timesyncd
|
||||||
service:
|
service:
|
||||||
name: "{{ cron_daemon }}"
|
name: "{{ timesyncd_daemon }}"
|
||||||
state: restarted
|
state: restarted
|
|
@ -3,22 +3,34 @@
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
# SE OMITE , SE REALIZA CON systemd-timesyncd.service
|
||||||
# paso1
|
# paso1
|
||||||
# install package ntpdate
|
# install package ntpdate
|
||||||
- name: install package ntpdate
|
#- name: install package ntpdate
|
||||||
apt:
|
# apt:
|
||||||
name: "{{ ntpdate_package }}"
|
# name: "{{ ntpdate_package }}"
|
||||||
state: present
|
# state: present
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
# paso2
|
# paso2
|
||||||
# copy timesync file to crontab.hourly
|
# copy timesync file to crontab.hourly
|
||||||
- name: copy file timesync to /etc/cron.hourly/timesync
|
#- name: copy file timesync to /etc/cron.hourly/timesync
|
||||||
copy:
|
# copy:
|
||||||
src: timesync
|
# src: timesync
|
||||||
dest: "{{ timesync_path }}"
|
# dest: "{{ timesync_path }}"
|
||||||
|
# owner: root
|
||||||
|
# group: root
|
||||||
|
# mode: '0644'
|
||||||
|
# backup: yes # NO backups
|
||||||
|
# notify: restart crontab hourly
|
||||||
|
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
# retocar fichero /etc/systemd/timesyncd.conf
|
||||||
|
- name: retocar fichero /etc/systemd/timesyncd.conf
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/systemd/timesyncd.conf
|
||||||
|
regexp: '^#NTP'
|
||||||
|
line: "NTP=time1.verdnatura.es time2.verdnatura.es"
|
||||||
owner: root
|
owner: root
|
||||||
group: root
|
group: root
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
# backup: yes # NO backups
|
notify: restart systemd-timesyncd
|
||||||
notify: restart crontab hourly
|
|
||||||
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
@ -1,4 +1,4 @@
|
||||||
# vars file
|
# vars file
|
||||||
ntpdate_package: ntpdate
|
ntpdate_package: ntpdate
|
||||||
timesync_path: /etc/cron.hourly/timesync
|
timesync_path: /etc/cron.hourly/timesync
|
||||||
cron_daemon: cron
|
timesyncd_daemon: systemd-timesyncd
|
Loading…
Reference in New Issue