ansible / ansible.builtin / v2.9.27 / 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.9.27) — module
pip
Install with pip install ansible==2.9.27
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 type: str 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 type: str 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 type: str
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: str key: description: The key in the section passed to the module to modify. returned: success sample: NewGuestName type: str 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: str 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: str 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: str value: description: The value passed to the module to modify to. returned: success sample: Guest Account type: str