2017-12-04 22:42:36 +00:00
|
|
|
#########################
|
|
|
|
### check mode remove ###
|
|
|
|
#########################
|
|
|
|
- name: check mode disable category
|
|
|
|
win_audit_policy_system:
|
|
|
|
category: "{{ category_name }}"
|
|
|
|
audit_type: none
|
|
|
|
check_mode: yes
|
|
|
|
register: category
|
|
|
|
|
|
|
|
- name: check mode disable subcategory
|
|
|
|
win_audit_policy_system:
|
|
|
|
subcategory: "{{ subcategory_name }}"
|
|
|
|
audit_type: none
|
|
|
|
check_mode: yes
|
|
|
|
register: subcategory
|
|
|
|
|
|
|
|
- name: check mode assert that changed is true
|
|
|
|
assert:
|
|
|
|
that:
|
2017-12-07 16:30:09 +00:00
|
|
|
- category is changed
|
|
|
|
- subcategory is changed
|
2017-12-04 22:42:36 +00:00
|
|
|
|
|
|
|
- name: check mode assert that audit_type is still "success" (old value) for category
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- item == "success"
|
|
|
|
with_items:
|
|
|
|
- "{{ category.current_audit_policy.values() | list | unique }}"
|
|
|
|
|
|
|
|
- name: check mode assert that audit_type is still "success and failure" (old value) for subcategory
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- item == "success and failure"
|
|
|
|
with_items:
|
|
|
|
- "{{ subcategory.current_audit_policy.values() | list }}"
|
|
|
|
|
|
|
|
######################
|
|
|
|
### disable policy ###
|
|
|
|
######################
|
|
|
|
|
|
|
|
- name: disable category
|
|
|
|
win_audit_policy_system:
|
|
|
|
category: "{{ category_name }}"
|
|
|
|
audit_type: none
|
|
|
|
register: category
|
|
|
|
|
|
|
|
- name: disable subcategory
|
|
|
|
win_audit_policy_system:
|
|
|
|
subcategory: "{{ subcategory_name }}"
|
|
|
|
audit_type: none
|
|
|
|
register: subcategory
|
|
|
|
|
|
|
|
- name: assert that changed is true
|
|
|
|
assert:
|
|
|
|
that:
|
2017-12-07 16:30:09 +00:00
|
|
|
- category is changed
|
|
|
|
- subcategory is changed
|
2017-12-04 22:42:36 +00:00
|
|
|
|
|
|
|
- name: assert that audit_type is "no auditing"
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- item == "no auditing"
|
|
|
|
with_items:
|
|
|
|
- "{{ subcategory.current_audit_policy.values() | list }}"
|
|
|
|
- "{{ category.current_audit_policy.values() | list | unique }}"
|
|
|
|
|
|
|
|
##########################
|
|
|
|
### idempotent disable ###
|
|
|
|
##########################
|
|
|
|
|
|
|
|
- name: idem disable category
|
|
|
|
win_audit_policy_system:
|
|
|
|
category: "{{ category_name }}"
|
|
|
|
audit_type: none
|
|
|
|
register: category
|
|
|
|
|
|
|
|
- name: idem disable subcategory
|
|
|
|
win_audit_policy_system:
|
|
|
|
subcategory: "{{ subcategory_name }}"
|
|
|
|
audit_type: none
|
|
|
|
register: subcategory
|
|
|
|
|
|
|
|
- name: idem assert that changed is false
|
|
|
|
assert:
|
|
|
|
that:
|
2017-12-07 16:30:09 +00:00
|
|
|
- category is not changed
|
|
|
|
- subcategory is not changed
|
2017-12-04 22:42:36 +00:00
|
|
|
|
|
|
|
- name: assert that audit_type is "no auditing"
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- item == "no auditing"
|
|
|
|
with_items:
|
|
|
|
- "{{ subcategory.current_audit_policy.values() | list }}"
|
|
|
|
- "{{ category.current_audit_policy.values() | list | unique }}"
|