summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tasks/clock-rhel-6.yml10
-rw-r--r--tasks/main.yml3
-rw-r--r--templates/clock.j21
3 files changed, 14 insertions, 0 deletions
diff --git a/tasks/clock-rhel-6.yml b/tasks/clock-rhel-6.yml
new file mode 100644
index 0000000..1cb176e
--- /dev/null
+++ b/tasks/clock-rhel-6.yml
@@ -0,0 +1,10 @@
+---
+- name: Check if clock file exists.
+ stat: path=/etc/sysconfig/clock
+ register: clock_file
+
+- name: Create clock file if it doesn't exist.
+ template:
+ src: clock.j2
+ dest: /etc/sysconfig/clock
+ when: clock_file.stat.exists == false
diff --git a/tasks/main.yml b/tasks/main.yml
index a022447..e88b109 100644
--- a/tasks/main.yml
+++ b/tasks/main.yml
@@ -10,6 +10,9 @@
- ntp
- tzdata
+- include: clock-rhel-6.yml
+ when: ansible_os_family == 'RedHat' and ansible_distribution_version.split('.')[0] == '6'
+
- name: Set timezone
timezone:
name: "{{ ntp_timezone }}"
diff --git a/templates/clock.j2 b/templates/clock.j2
new file mode 100644
index 0000000..873283f
--- /dev/null
+++ b/templates/clock.j2
@@ -0,0 +1 @@
+ZONE="{{ ntp_timezone }}"