diff --git a/roles/common/tasks/ntp.yml b/roles/common/tasks/ntp.yml index 2c97b4b..66fcb8f 100644 --- a/roles/common/tasks/ntp.yml +++ b/roles/common/tasks/ntp.yml @@ -4,8 +4,11 @@ # client. - name: Set timezone - when: timezone is defined and ansible_service_mgr == 'systemd' - command: /usr/bin/timedatectl set-timezone {{ timezone }} + when: + - timezone is defined + - ansible_service_mgr == 'systemd' + community.general.timezone: + name: "{{ timezone }}" tags: timezone # Apparently some cloud images don't have this installed by default. From what