2018-05-25 19:01:03 +02:00
|
|
|
# Because hwclock usually isn't available inside Docker containers in Shippable
|
|
|
|
# these tasks will detect if hwclock works and only run hwclock tests if it is
|
|
|
|
# supported. That is why it is recommended to run these tests locally with
|
|
|
|
# `--docker-privileged` on centos6, centos7 and ubuntu1404 images. Example
|
|
|
|
# command to run on centos6:
|
|
|
|
#
|
|
|
|
# ansible-test integration --docker centos6 --docker-privileged -v timezone
|
|
|
|
|
|
|
|
##
|
|
|
|
## set path to timezone config files
|
|
|
|
##
|
|
|
|
|
|
|
|
- name: set config file path on Debian
|
|
|
|
set_fact:
|
|
|
|
timezone_config_file: '/etc/timezone'
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: set config file path on RedHat
|
|
|
|
set_fact:
|
|
|
|
timezone_config_file: '/etc/sysconfig/clock'
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
|
|
|
##
|
|
|
|
## set path to hwclock config files
|
|
|
|
##
|
|
|
|
|
|
|
|
- name: set config file path on Debian
|
|
|
|
set_fact:
|
|
|
|
hwclock_config_file: '/etc/default/rcS'
|
|
|
|
when: ansible_os_family == 'Debian'
|
|
|
|
|
|
|
|
- name: set config file path on RedHat
|
|
|
|
set_fact:
|
|
|
|
hwclock_config_file: '/etc/sysconfig/clock'
|
|
|
|
when: ansible_os_family == 'RedHat'
|
|
|
|
|
2018-05-25 23:15:15 +02:00
|
|
|
####
|
|
|
|
#### timezone tests
|
|
|
|
####
|
2018-05-25 19:01:03 +02:00
|
|
|
|
|
|
|
- name: set timezone to Etc/UTC
|
2017-10-20 08:02:38 +02:00
|
|
|
timezone:
|
|
|
|
name: Etc/UTC
|
2018-04-25 22:30:06 +02:00
|
|
|
register: original_timezone
|
2017-10-20 08:02:38 +02:00
|
|
|
|
2018-05-25 19:01:03 +02:00
|
|
|
- block:
|
2018-05-25 23:15:15 +02:00
|
|
|
- include: test.yml
|
|
|
|
always:
|
|
|
|
- name: Restore original system timezone - {{ original_timezone.diff.before.name }}
|
2018-05-25 19:01:03 +02:00
|
|
|
timezone:
|
2018-05-25 23:15:15 +02:00
|
|
|
name: "{{ original_timezone.diff.before.name }}"
|