ansible/test/integration/targets/timezone/tasks/main.yml
Will Thames 0c10e1ebe4 Handle timezone updates on Ubuntu 16.04+ on containers (#27546)
* Handle timezone updates on Ubuntu 16.04+ on containers

Although Ubuntu 16.04 will use timedatectl by default,
containers without a working timedatectl need to use the
old method.

A bug in Ubuntu for the old method means having to write
a nasty hack

https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1554806

* Add tests for timezones

Ensure timezone changes work across various OSs
2017-10-20 16:02:38 +10:00

15 lines
366 B
YAML

- name: set timezone to Etc/UTC
timezone:
name: Etc/UTC
- name: set timezone to Australia/Brisbane
timezone:
name: Australia/Brisbane
register: timezone_set
- name: ensure timezone changed
assert:
that:
- timezone_set.changed
- timezone_set.diff.after.name == 'Australia/Brisbane'
- timezone_set.diff.before.name == 'Etc/UTC'