Change ntp-server role formatting

This commit is contained in:
Alexander Dietrich 2017-02-05 13:47:57 +01:00
parent 17468493cc
commit 9ff6b69b82
2 changed files with 18 additions and 9 deletions

View file

@ -1,3 +1,5 @@
---
- name: restart ntpd
service: name=ntp state=restarted
service:
name: ntp
state: restarted

View file

@ -1,14 +1,21 @@
---
- name: be sure ntp is installed
apt: name=ntp state=latest
- name: install ntpd
apt:
name: ntp
state: present
tags: ntp
- name: be sure ntp is configured
template: src=ntp.conf.j2 dest=/etc/ntp.conf
notify:
- restart ntpd
- name: template ntp.conf
template:
src: ntp.conf.j2
dest: /etc/ntp.conf
backup: yes
notify: restart ntpd
tags: ntp
- name: be sure ntpd is running and enabled
service: name=ntp state=started enabled=yes
- name: start and enable ntpd
service:
name: ntp
state: started
enabled: yes
tags: ntp