1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Revert "win_security_policy: allow removing values (resolves #40869) (#41125)" (#41986)

This reverts commit f2bd6b6bfd.
This commit is contained in:
Jordan Borean 2018-06-27 09:37:37 +10:00 committed by GitHub
parent f2bd6b6bfd
commit cc97e89620
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 40 deletions

View file

@ -194,8 +194,6 @@ if ($will_change -eq $true) {
if ($new_value -cne $value) { if ($new_value -cne $value) {
Fail-Json $result "Failed to change the value for key '$key' in section '$section', the value is still $new_value" Fail-Json $result "Failed to change the value for key '$key' in section '$section', the value is still $new_value"
} }
} elseif ([string]$value -eq "") {
# Value was empty, so OK if no longer in the result
} else { } else {
Fail-Json $result "The key '$key' in section '$section' is not a valid key, cannot set this value" Fail-Json $result "The key '$key' in section '$section' is not a valid key, cannot set this value"
} }

View file

@ -131,41 +131,3 @@
that: that:
- change_existing_string_again is not changed - change_existing_string_again is not changed
- change_existing_string_again.value == "New Guest" - change_existing_string_again.value == "New Guest"
- name: add policy setting
win_security_policy:
section: Privilege Rights
# following key is empty by default
key: SeCreateTokenPrivilege
# add Guests
value: '*S-1-5-32-546'
- name: get actual policy setting
test_win_security_policy:
section: Privilege Rights
key: SeCreateTokenPrivilege
register: add_policy_setting_actual
- name: assert remove policy setting
assert:
that:
- add_policy_setting_actual.value == '*S-1-5-32-546'
- name: remove policy setting
win_security_policy:
section: Privilege Rights
key: SeCreateTokenPrivilege
value: ''
register: remove_policy_setting
- name: get actual policy setting
test_win_security_policy:
section: Privilege Rights
key: SeCreateTokenPrivilege
register: remove_policy_setting_actual
- name: assert remove policy setting
assert:
that:
- remove_policy_setting is changed
- remove_policy_setting_actual.value is none