change ntp to chrony with amazon time server

This commit is contained in:
Vitaly Znachenok 2017-12-07 16:27:25 +03:00
parent 0dfcb31c0e
commit eb487fdddf
3 changed files with 25 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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