From 567078d7c3ac7190d6748f0cfcd535e82912a12b Mon Sep 17 00:00:00 2001 From: kadecole Date: Thu, 18 Jun 2015 00:23:06 -0500 Subject: Add a managed ntp.conf template. --- tasks/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'tasks') 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 -- cgit v1.2.3