mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 11:10:21 -07:00
Properly reset timezone in user test when it was originally n/a (#55389)
This commit is contained in:
parent
da1f86a40f
commit
b4e83642c8
1 changed files with 19 additions and 0 deletions
|
@ -326,6 +326,8 @@
|
||||||
state: present
|
state: present
|
||||||
expires: 2529881062
|
expires: 2529881062
|
||||||
register: user_test_expires1
|
register: user_test_expires1
|
||||||
|
tags:
|
||||||
|
- timezone
|
||||||
|
|
||||||
- name: Set user expiration again to ensure no change is made
|
- name: Set user expiration again to ensure no change is made
|
||||||
user:
|
user:
|
||||||
|
@ -333,6 +335,8 @@
|
||||||
state: present
|
state: present
|
||||||
expires: 2529881062
|
expires: 2529881062
|
||||||
register: user_test_expires2
|
register: user_test_expires2
|
||||||
|
tags:
|
||||||
|
- timezone
|
||||||
|
|
||||||
- name: Ensure that account with expiration was created and did not change on subsequent run
|
- name: Ensure that account with expiration was created and did not change on subsequent run
|
||||||
assert:
|
assert:
|
||||||
|
@ -382,16 +386,31 @@
|
||||||
state: present
|
state: present
|
||||||
expires: 2529881062
|
expires: 2529881062
|
||||||
register: user_test_different_tz
|
register: user_test_different_tz
|
||||||
|
tags:
|
||||||
|
- timezone
|
||||||
|
|
||||||
- name: Ensure that no change was reported
|
- name: Ensure that no change was reported
|
||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- user_test_different_tz is not changed
|
- user_test_different_tz is not changed
|
||||||
|
tags:
|
||||||
|
- timezone
|
||||||
|
|
||||||
always:
|
always:
|
||||||
- name: Restore original timezone - {{ original_timezone.diff.before.name }}
|
- name: Restore original timezone - {{ original_timezone.diff.before.name }}
|
||||||
timezone:
|
timezone:
|
||||||
name: "{{ original_timezone.diff.before.name }}"
|
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:
|
tags:
|
||||||
- timezone
|
- timezone
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue