Co-authored-by: MKletz <michael.kletz.27@gmail.com> Co-authored-by: Ajay Chenampara <ajay.chenampara@gmail.com> Co-authored-by: dlemons-redhat <69318976+dlemons-redhat@users.noreply.github.com> Co-authored-by: Nicolas Leiva <nicolasleiva@gmail.com> Co-authored-by: benblasco <42140583+benblasco@users.noreply.github.com> Co-authored-by: Benjamin Blasco <bblasco@redhat.com> Co-authored-by: calvingsmith <4283930+calvingsmith@users.noreply.github.com> Co-authored-by: Calvin Smith <calvingsmith@users.noreply.github.com> Co-authored-by: Hicham Mourad <43329991+HichamMourad@users.noreply.github.com>
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
- name: PowerShell DSC
|
|
hosts: "{{ _hosts | default('os_windows') }}"
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
- name: Setup the SecurityPolicyDSC module
|
|
community.windows.win_psmodule:
|
|
name: SecurityPolicyDSC
|
|
module_version: 2.10.0.0
|
|
state: present
|
|
accept_license: true
|
|
|
|
- name: Set password history
|
|
ansible.windows.win_dsc:
|
|
resource_name: AccountPolicy
|
|
Name: Enforce_password_history
|
|
Enforce_password_history: 24
|
|
|
|
- name: Set maximum password age
|
|
ansible.windows.win_dsc:
|
|
resource_name: AccountPolicy
|
|
Name: Maximum_Password_Age
|
|
Maximum_Password_Age: 60
|
|
|
|
- name: Set minimum password age
|
|
ansible.windows.win_dsc:
|
|
resource_name: AccountPolicy
|
|
Name: Minimum_Password_Age
|
|
Maximum_Password_Age: 20
|
|
|
|
- name: Set minimum password length
|
|
ansible.windows.win_dsc:
|
|
resource_name: AccountPolicy
|
|
Name: Minimum_Password_Length
|
|
Maximum_Password_Age: 8
|
|
|
|
- name: Set password complexity requirements
|
|
ansible.windows.win_dsc:
|
|
resource_name: AccountPolicy
|
|
Name: Password_must_meet_complexity_requirements
|
|
Password_must_meet_complexity_requirements: Enabled
|