change ntp to chrony with amazon time server
This commit is contained in:
parent
0dfcb31c0e
commit
eb487fdddf
|
@ -2,5 +2,8 @@
|
|||
- name: restart ntpd
|
||||
service: name=ntpd state=restarted
|
||||
|
||||
- name: restart chrony
|
||||
service: name=chrony state=restarted
|
||||
|
||||
- name: restart sshd
|
||||
service: name=sshd state=restarted
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
- name: Install chrony package
|
||||
apt: name={{ item }}
|
||||
with_items:
|
||||
- chrony
|
||||
|
||||
- name: Select Amazon time server
|
||||
lineinfile:
|
||||
dest: /etc/chrony/chrony.conf
|
||||
# regexp: ''
|
||||
insertafter: '^pool'
|
||||
line: 'server 169.254.169.123 prefer iburst'
|
||||
# backrefs: yes
|
||||
state: present
|
||||
notify:
|
||||
- restart chrony
|
||||
|
||||
|
||||
- name: Ensure chrony is running and enabled to start at boot
|
||||
service: name=chrony state=started enabled=yes
|
|
@ -6,7 +6,8 @@
|
|||
- include: ssh.yml
|
||||
- include: packages.yml
|
||||
- include: vars.yml
|
||||
- include: ntp.yml
|
||||
#- include: ntp.yml
|
||||
- include: chrony.yml
|
||||
- include: logrotate.yml
|
||||
- include: swap.yml
|
||||
|
||||
|
|
Loading…
Reference in New Issue