summaryrefslogtreecommitdiffstats
path: root/tasks/main.yml
diff options
context:
space:
mode:
authorkadecole <kcole@yahoo.com>2015-06-18 00:23:06 -0500
committerJeff Geerling <geerlingguy@mac.com>2016-03-03 22:35:50 -0600
commit567078d7c3ac7190d6748f0cfcd535e82912a12b (patch)
treeec062a64a2a5b2fa7cc1112d86281e24add57816 /tasks/main.yml
parent2bfe67855da09a0b3b1cdb0d751b115fa42f1c36 (diff)
downloadntp-567078d7c3ac7190d6748f0cfcd535e82912a12b.tar.gz
ntp-567078d7c3ac7190d6748f0cfcd535e82912a12b.tar.bz2
ntp-567078d7c3ac7190d6748f0cfcd535e82912a12b.tar.xz
ntp-567078d7c3ac7190d6748f0cfcd535e82912a12b.zip
Add a managed ntp.conf template.
Diffstat (limited to 'tasks/main.yml')
-rw-r--r--tasks/main.yml12
1 files changed, 9 insertions, 3 deletions
diff --git a/tasks/main.yml b/tasks/main.yml
index 2844315..b6213ba 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -8,18 +8,19 @@
dest: /etc/localtime
state: link
force: yes
+ when: ntp_enabled
- name: Install NTP (RedHat).
yum: name=ntp state=installed
- when: ansible_os_family == 'RedHat'
+ when: ansible_os_family == 'RedHat' and ntp_enabled
- name: Install NTP (Debian).
apt: name=ntp state=installed
- when: ansible_os_family == 'Debian'
+ when: ansible_os_family == 'Debian' and ntp_enabled
- name: Install NTP (FreeBSD).
pkgng: name=ntp state=present
- when: ansible_os_family == 'FreeBSD'
+ when: ansible_os_family == 'FreeBSD' and ntp_enabled
- name: Ensure NTP is running and enabled at system start.
service:
@@ -34,3 +35,8 @@
state: stopped
enabled: no
when: not ntp_enabled
+
+- name: Generate ntp.conf file
+ template: src=ntp.conf.j2 dest=/etc/ntp.conf
+ notify: restart ntp
+ when: ntp_enabled