community.windows.win_audit_policy_system module – Used to make changes to the system wide Audit Policy
This module is part of the community.windows collection (version 1.12.0).
You might already have this collection installed if you are using the
It is not included in
To check whether it is installed, run
ansible-galaxy collection list.
To install it, use:
ansible-galaxy collection install community.windows.
To use it in a playbook, specify:
Used to make changes to the system wide Audit Policy.
The type of event you would like to audit for.
Accepts a list. See examples.
Single string value for the category you would like to adjust the policy on.
Cannot be used with subcategory. You must define one or the other.
Changing this setting causes all subcategories to be adjusted to the defined audit_type.
Single string value for the subcategory you would like to adjust the policy on.
Cannot be used with category. You must define one or the other.
It is recommended to take a backup of the policies before adjusting them for the first time.
See this page for in depth information https://technet.microsoft.com/en-us/library/cc766468.aspx.
Adds an audit rule to files, folders, or registry keys.
- name: Enable failure auditing for the subcategory "File System" community.windows.win_audit_policy_system: subcategory: File System audit_type: failure - name: Enable all auditing types for the category "Account logon events" community.windows.win_audit_policy_system: category: Account logon events audit_type: success, failure - name: Disable auditing for the subcategory "File System" community.windows.win_audit_policy_system: subcategory: File System audit_type: none
Common return values are documented here, the following are the fields unique to this module:
details on the policy being targetted