summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2019-04-16 14:12:13 -0400
committerToshio Kuratomi <a.badger@gmail.com>2019-04-24 14:45:52 -0600
commitf64e95f230458950e13cf8b8bdbaa0b02bd45b16 (patch)
treeff0da7bd3e8573d69097ed3051ae93a46d2c5fb3
parent76f6d21ff3e7bb5118cb078b6924905ce012e9e6 (diff)
downloadansible-f64e95f230458950e13cf8b8bdbaa0b02bd45b16.tar.gz
Properly reset timezone in user test when it was originally n/a (#55389)
(cherry picked from commit b4e83642c8f0e354c3a448667d3ebebf833c0cf6)
-rw-r--r--test/integration/targets/user/tasks/main.yml19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/integration/targets/user/tasks/main.yml b/test/integration/targets/user/tasks/main.yml
index 591efba2d3..fe5e931afa 100644
--- a/test/integration/targets/user/tasks/main.yml
+++ b/test/integration/targets/user/tasks/main.yml
@@ -326,6 +326,8 @@
state: present
expires: 2529881062
register: user_test_expires1
+ tags:
+ - timezone
- name: Set user expiration again to ensure no change is made
user:
@@ -333,6 +335,8 @@
state: present
expires: 2529881062
register: user_test_expires2
+ tags:
+ - timezone
- name: Ensure that account with expiration was created and did not change on subsequent run
assert:
@@ -382,16 +386,31 @@
state: present
expires: 2529881062
register: user_test_different_tz
+ tags:
+ - timezone
- name: Ensure that no change was reported
assert:
that:
- user_test_different_tz is not changed
+ tags:
+ - timezone
always:
- name: Restore original timezone - {{ original_timezone.diff.before.name }}
timezone:
name: "{{ original_timezone.diff.before.name }}"
+ when: original_timezone.diff.before.name != "n/a"
+ tags:
+ - timezone
+
+ - name: Restore original timezone when n/a
+ file:
+ path: /etc/sysconfig/clock
+ state: absent
+ when:
+ - original_timezone.diff.before.name == "n/a"
+ - "'/etc/sysconfig/clock' in original_timezone.msg"
tags:
- timezone