From 6a0b28246f7349936562ae89de33ab3f707f1b11 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 16 Apr 2019 16:39:04 +0200 Subject: [PATCH] add time option --- defaults/main.yml | 5 ++++- tasks/time.yml | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 823d714..fb3e695 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,4 +6,7 @@ arch_base_timezone: Europe/Paris arch_base_locales: [ "fr_FR.UTF-8", "en_US.UTF-8" -] \ No newline at end of file +] +time: + hwclock: UTC + timezone: Europe/Paris \ No newline at end of file diff --git a/tasks/time.yml b/tasks/time.yml index 7ff4e0b..d9da526 100644 --- a/tasks/time.yml +++ b/tasks/time.yml @@ -3,4 +3,10 @@ command: timedatectl set-ntp true become: yes args: - creates: /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service \ No newline at end of file + creates: /etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service + +- name: Set timezone and hardware clock + timezone: + hwclock: '{{ time.hwclock }}' + name: '{{ time.timezone }}' + become: yes \ No newline at end of file