Skip to content

Commit

Permalink
ntp: add module, synchronise time on first install
Browse files Browse the repository at this point in the history
  • Loading branch information
stelcheck committed Dec 10, 2018
1 parent 4c9873a commit 39faa23
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docker-image/ansible/roles/ntp/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- name: "Install ntp"
yum:
name: ntp
state: latest
register: ntp_installed

- name: "Sychronize time"
shell: ntpdate pool.ntp.org
when: ntp_installed.changed

- name: "Ensure NTP Daemon is running"
service:
name: ntpd
enabled: yes

0 comments on commit 39faa23

Please sign in to comment.