summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md9
-rw-r--r--tasks/main.yml6
-rw-r--r--vars/main.yml2
3 files changed, 13 insertions, 4 deletions
diff --git a/README.md b/README.md
index 53d5826..92ac061 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
# Ansible Role: NTP
-Installs NTP on RHEL/CentOS and Debian/Ubuntu.
+[![Build Status](https://travis-ci.org/geerlingguy/ansible-role-ntp.svg?branch=master)](https://travis-ci.org/geerlingguy/ansible-role-ntp)
+
+Installs NTP on RedHat/CentOS and Debian/Ubuntu Linux servers.
## Requirements
@@ -10,10 +12,15 @@ None.
Available variables are listed below, along with default values (see `vars/main.yml`):
+ ntp_enabled: true
+
+Whether to start the ntpd service and enable it at system boot. On many virtual machines that run inside a container (like OpenVZ or VirtualBox), it's recommended you don't run the NTP daemon, since the host itself should be set to synchronize time for all it's child VMs.
+
ntp_timezone: America/Chicago
Set the timezone for your server.
+
## Dependencies
None.
diff --git a/tasks/main.yml b/tasks/main.yml
index 19343f2..144c455 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -14,4 +14,8 @@
when: ansible_os_family == 'Debian'
- name: Ensure NTP is running.
- service: name={{ ntp_daemon }} state=started enabled=yes
+ service: >
+ name={{ ntp_daemon }}
+ state=started
+ enabled=yes
+ when: ntp_enabled
diff --git a/vars/main.yml b/vars/main.yml
deleted file mode 100644
index 424c7ec..0000000
--- a/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-ntp_timezone: America/Chicago \ No newline at end of file