1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/integration/targets/timezone/tasks/main.yml

21 lines
619 B
YAML

- name: Set timezone to Etc/UTC
timezone:
name: Etc/UTC
register: original_timezone
- block:
- name: Set timezone to Australia/Brisbane
timezone:
name: Australia/Brisbane
register: timezone_set
- name: Ensure timezone changed
assert:
that:
- timezone_set is changed
- timezone_set.diff.after.name == 'Australia/Brisbane'
- timezone_set.diff.before.name == 'Etc/UTC'
always:
- name: Restore original system timezone - {{ original_timezone.diff.before.name }}
timezone:
name: "{{ original_timezone.diff.before.name }}"