Skip to content

Commit 6505157

Browse files
authored
Merge pull request #101 from dev-sec/update_pwqual
update template
2 parents fa59170 + 62a9101 commit 6505157

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ os_auth_lockout_time: 600 # 10min
88
os_auth_timeout: 60
99
os_auth_allow_homeless: false
1010
os_auth_pam_passwdqc_enable: true
11-
os_auth_pam_passwdqc_options: 'min=disabled,disabled,16,12,8'
11+
os_auth_pam_passwdqc_options: 'min=disabled,disabled,16,12,8' # used in RHEL6
12+
os_auth_pam_pwquality_options: 'try_first_pass retry=3 type=' # used in RHEL7
1213
os_auth_root_ttys: [console, tty1, tty2, tty3, tty4, tty5, tty6]
1314
os_auth_uid_min: 1000
1415
os_auth_gid_min: 1000

templates/rhel_system_auth.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ account sufficient pam_succeed_if.so uid < 500 quiet
1919
account required pam_permit.so
2020

2121
{% if os_auth_pam_passwdqc_enable %}
22+
{% if ansible_distribution == 'RedHat' or ansible_distribution == 'Oracle Linux' and ansible_distribution_version >= '7' %}
23+
password required pam_pwquality.so {{os_auth_pam_pwquality_options}}
24+
{% else %}
2225
password requisite pam_passwdqc.so {{os_auth_pam_passwdqc_options}}
26+
{% endif %}
2327
{% else %}
2428
password requisite pam_cracklib.so try_first_pass retry=3 type=
2529
{% endif %}

0 commit comments

Comments
 (0)