From fd9f99697d3f06f636d13a34206202eb26c5ca17 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Fri, 9 May 2014 09:37:55 -0500 Subject: Add ntp_enabled variable and Travis CI test integration. --- README.md | 9 ++++++++- tasks/main.yml | 6 +++++- vars/main.yml | 2 -- 3 files changed, 13 insertions(+), 4 deletions(-) delete mode 100644 vars/main.yml 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 -- cgit v1.2.1