summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJirayut Nimsaeng <wingth@gmail.com>2017-05-09 20:26:42 +0700
committerJirayut Nimsaeng <wingth@gmail.com>2017-05-09 20:26:42 +0700
commita24f36cf657799d793a5e364753c38f5ebd902c4 (patch)
tree7eb9f6e92ae7d1067b70692f29dd059a3a56b6e6
parent99451f84030d78f92b435881a542495016aafdc0 (diff)
downloadntp-a24f36cf657799d793a5e364753c38f5ebd902c4.tar.gz
ntp-a24f36cf657799d793a5e364753c38f5ebd902c4.tar.bz2
ntp-a24f36cf657799d793a5e364753c38f5ebd902c4.tar.xz
ntp-a24f36cf657799d793a5e364753c38f5ebd902c4.zip
Use timezone module and bump required minimum Ansible version to 2.2
-rw-r--r--meta/main.yml2
-rw-r--r--tasks/main.yml21
2 files changed, 2 insertions, 21 deletions
diff --git a/meta/main.yml b/meta/main.yml
index 4cfa5a2..9e6dd69 100644
--- a/meta/main.yml
+++ b/meta/main.yml
@@ -6,7 +6,7 @@ galaxy_info:
description: NTP installation and configuration for Linux.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
- min_ansible_version: 1.8
+ min_ansible_version: 2.2
platforms:
- name: EL
versions:
diff --git a/tasks/main.yml b/tasks/main.yml
index 491c04d..8a14050 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -2,28 +2,9 @@
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
-- name: Configure timezone (For Ansible 2.2+)
+- name: Set timezone
timezone:
name: "{{ ntp_timezone }}"
- when: ansible_version.full >= "02.02.00.00"
-
-- name: Set the correct timezone. (For Ansible prior 2.2)
- file:
- src: "/usr/share/zoneinfo/{{ ntp_timezone }}"
- dest: /etc/localtime
- state: link
- force: yes
- when: ansible_version.full < "02.02.00.00"
-
-# Debian family OSes also have an /etc/timezone file.
-- name: Set timezone in /etc/timezone file. (For Ansible prior 2.2)
- template:
- src: timezone.j2
- dest: /etc/timezone
- force: yes
- when:
- - ansible_os_family == 'Debian'
- - ansible_version.full < "02.02.00.00"
- name: Install NTP.
package: