-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
tests/integration/targets/win_audit_policy_system/tasks/modify.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
######################## | ||
### check mode modify ### | ||
######################## | ||
- name: check mode modify category | ||
win_audit_policy_system: | ||
category: "{{ category_name }}" | ||
audit_type: failure | ||
check_mode: yes | ||
register: category | ||
|
||
- name: check mode modify subcategory | ||
win_audit_policy_system: | ||
subcategory: "{{ subcategory_name }}" | ||
audit_type: failure | ||
check_mode: yes | ||
register: subcategory | ||
|
||
- name: check mode assert that changed is true | ||
assert: | ||
that: | ||
- category is changed | ||
- subcategory is changed | ||
|
||
- name: modify assert that audit_type is "success" for category | ||
assert: | ||
that: | ||
- item == "success" | ||
with_items: | ||
- "{{ category.current_audit_policy.values() | list | unique }}" | ||
|
||
- name: modify assert that audit_type is "success and failure" for subcategory | ||
assert: | ||
that: | ||
- item == "success and failure" | ||
with_items: | ||
- "{{ subcategory.current_audit_policy.values() | list }}" | ||
|
||
|
||
#################### | ||
### apply change ### | ||
#################### | ||
|
||
- name: modify category | ||
win_audit_policy_system: | ||
category: "{{ category_name }}" | ||
audit_type: failure | ||
register: category | ||
|
||
- name: modify subcategory | ||
win_audit_policy_system: | ||
subcategory: "{{ subcategory_name }}" | ||
audit_type: failure | ||
register: subcategory | ||
|
||
- name: modify assert that changed is true | ||
assert: | ||
that: | ||
- category is changed | ||
- subcategory is changed | ||
|
||
- name: modify assert that audit_type is "success" for category | ||
assert: | ||
that: | ||
- item == "failure" | ||
with_items: | ||
- "{{ category.current_audit_policy.values() | list | unique }}" | ||
- "{{ subcategory.current_audit_policy.values() | list }}" | ||
|
||
|
||
############################### | ||
### idempotent apply change ### | ||
############################### | ||
|
||
- name: idem modify category | ||
win_audit_policy_system: | ||
category: "{{ category_name }}" | ||
audit_type: failure | ||
register: category | ||
|
||
- name: idem modify subcategory | ||
win_audit_policy_system: | ||
subcategory: "{{ subcategory_name }}" | ||
audit_type: failure | ||
register: subcategory | ||
|
||
- name: idem assert that changed is false | ||
assert: | ||
that: | ||
- category is not changed | ||
- subcategory is not changed | ||
|
||
- name: idem assert that audit_type is "success" for category | ||
assert: | ||
that: | ||
- item == "failure" | ||
with_items: | ||
- "{{ category.current_audit_policy.values() | list | unique }}" | ||
- "{{ subcategory.current_audit_policy.values() | list }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters