aboutsummaryrefslogtreecommitdiffstats
path: root/roles/timezone/tasks/main.yml
blob: a62a5e4c3ac6803e87dd8608fffaab601a9488d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
- name: check if system clock uses localtime
  command: timedatectl show --property LocalRTC --value
  changed_when: false
  register: timezone_localrtc

- name: set system clock to UTC
  command: timedatectl --adjust-system-clock set-local-rtc 0
  when: timezone_localrtc.stdout != "no"

- name: set timezone
  timezone:
    name: '{{ timezone }}'