summaryrefslogtreecommitdiffstats
path: root/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'tasks/main.yml')
-rw-r--r--tasks/main.yml26
1 files changed, 9 insertions, 17 deletions
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: