summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Geerling <geerlingguy@mac.com>2017-06-11 14:46:31 -0500
committerJeff Geerling <geerlingguy@mac.com>2017-06-11 14:46:31 -0500
commita9767d7c6639eeea8b45564f7ddb5018680aea3d (patch)
treebaa33b7b10d47e55623db5a482279cc09f4779a6
parentfbd7badf560bb0a18736acaa3ec6416863c0a615 (diff)
parent86b8f5a1028386665c2c43bff2962b8ea476be78 (diff)
downloadntp-a9767d7c6639eeea8b45564f7ddb5018680aea3d.tar.gz
ntp-a9767d7c6639eeea8b45564f7ddb5018680aea3d.tar.bz2
ntp-a9767d7c6639eeea8b45564f7ddb5018680aea3d.tar.xz
ntp-a9767d7c6639eeea8b45564f7ddb5018680aea3d.zip
Merge branch 'opsta-ansible22'
-rw-r--r--.travis.yml2
-rw-r--r--meta/main.yml2
-rw-r--r--tasks/main.yml26
3 files changed, 11 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml
index 6eb20a4..563f83c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,7 @@ env:
- distro: ubuntu1404
- distro: ubuntu1204
- distro: fedora24
- # - distro: debian8
+ - distro: debian8
script:
# Download test shim.
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 afe3731..a022447 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -2,25 +2,17 @@
- name: Include OS-specific variables.
include_vars: "{{ ansible_os_family }}.yml"
-- name: Set the correct timezone.
- file:
- src: "/usr/share/zoneinfo/{{ ntp_timezone }}"
- dest: /etc/localtime
- state: link
- force: yes
-
-# Debian family OSes also have an /etc/timezone file.
-- name: Set timezone in /etc/timezone file.
- template:
- src: timezone.j2
- dest: /etc/timezone
- force: yes
- when: ansible_os_family == 'Debian'
-
-- name: Install NTP.
+- name: Ensure NTP-related packages are installed.
package:
- name: ntp
+ name: "{{ item }}"
state: present
+ with_items:
+ - ntp
+ - tzdata
+
+- name: Set timezone
+ timezone:
+ name: "{{ ntp_timezone }}"
- name: Ensure NTP is running and enabled as configured.
service: