summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Geerling <geerlingguy@mac.com>2014-05-09 09:37:55 -0500
committerJeff Geerling <geerlingguy@mac.com>2014-05-09 09:37:55 -0500
commitfd9f99697d3f06f636d13a34206202eb26c5ca17 (patch)
treebf698dddc4436ad54843a5b3577734be8647dd6b
parent884da1935c36ab66fabd08c3e0d7d0ce04c522ac (diff)
downloadntp-fd9f99697d3f06f636d13a34206202eb26c5ca17.tar.gz
ntp-fd9f99697d3f06f636d13a34206202eb26c5ca17.tar.bz2
ntp-fd9f99697d3f06f636d13a34206202eb26c5ca17.tar.xz
ntp-fd9f99697d3f06f636d13a34206202eb26c5ca17.zip
Add ntp_enabled variable and Travis CI test integration.
-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