ansible / ansible.builtin / v2.7.10 / module / win_security_policy Change local security policy settings | "added in version" 2.4 of ansible.builtin" Authors: Jordan Borean (@jborean93) preview | supported by communityansible.builtin.win_security_policy (v2.7.10) — module
pip
Install with pip install ansible==2.7.10
Allows you to set the local security policies that are configured by SecEdit.exe.
- name: change the guest account name win_security_policy: section: System Access key: NewGuestName value: Guest Account
- name: set the maximum password age win_security_policy: section: System Access key: MaximumPasswordAge value: 15
- name: do not store passwords using reversible encryption win_security_policy: section: System Access key: ClearTextPassword value: 0
- name: enable system events win_security_policy: section: Event Audit key: AuditSystemEvents value: 1
key: description: - The ini key of the section or policy name to modify. - The module will return an error if this key is invalid. required: true value: description: - The value for the ini key or policy name. - If the key takes in a boolean value then 0 = False and 1 = True. required: true section: description: - The ini section the key exists in. - If the section does not exist then the module will return an error. - Example sections to use are 'Account Policies', 'Local Policies', 'Event Log', 'Restricted Groups', 'System Services', 'Registry' and 'File System' - If wanting to edit the C(Privilege Rights) section, use the M(win_user_right) module instead. required: true
import_log: description: The log of the SecEdit.exe /configure job that configured the local policies. This is used for debugging purposes on failures. returned: secedit.exe /import run and change occurred sample: Completed 6 percent (0/15) \tProcess Privilege Rights area. type: string key: description: The key in the section passed to the module to modify. returned: success sample: NewGuestName type: string rc: description: The return code after a failure when running SecEdit.exe. returned: failure with secedit calls sample: -1 type: int section: description: The section passed to the module to modify. returned: success sample: System Access type: string stderr: description: The output of the STDERR buffer after a failure when running SecEdit.exe. returned: failure with secedit calls sample: failed to import security policy type: string stdout: description: The output of the STDOUT buffer after a failure when running SecEdit.exe. returned: failure with secedit calls sample: check log for error details type: string value: description: The value passed to the module to modify to. returned: success sample: Guest Account type: string