blob: 9ae67837f6c7fac8030a5679d3ff9fd1c2ee77b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
---
- 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
- name: Install NTP (RedHat).
yum: name=ntp state=installed
when: ansible_os_family == 'RedHat'
- name: Install NTP (Debian).
apt: name=ntp state=installed
when: ansible_os_family == 'Debian'
- name: Ensure NTP is running and enabled at system start.
service: >
name={{ ntp_daemon }}
state=started
enabled=yes
when: ntp_enabled
- name: Ensure NTP is stopped and disabled at system start.
service: >
name={{ ntp_daemon }}
state=stopped
enabled=no
when: not ntp_enabled
|