Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

{{{ ansible_instantiate_variables("var_password_pam_retry") }}}

{{% if product == 'sle16' %}}
{{{ ansible_copy_distro_defaults('/usr/lib/security/pwquality.conf', pwquality_path, rule_title=rule_title) }}}
{{% endif %}}

{{% if product in ['rhel8', 'rhel9', 'almalinux', 'sle15', 'sle16'] -%}}
- name: Ensure PAM variable retry is set accordingly
ansible.builtin.lineinfile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

{{{ bash_instantiate_variables("var_password_pam_retry") }}}

{{% if product == 'sle16' %}}
{{{ bash_copy_distro_defaults('/usr/lib/security/pwquality.conf', pwquality_path) }}}
{{% endif %}}

{{% if 'rhel' in product or product in ['sle15', 'sle16'] -%}}
{{{ bash_replace_or_append(pwquality_path,
'^retry',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
# packages = authselect
# platform = multi_platform_rhel
# platform = multi_platform_rhel,multi_platform_sle
# variables = var_password_pam_retry=3
{{% if product in ['sle15', 'sle16'] %}}
# packages = libpwquality1
{{% else %}}
# packages = authselect
{{% endif %}}

source common.sh

Expand All @@ -13,10 +17,11 @@ if grep -q "^.*retry\s*=" "$CONF_FILE"; then
else
echo "retry = $retry_cnt" >> "$CONF_FILE"
fi

{{% if product not in ['sle15', 'sle16'] %}}
for file in ${configuration_files[@]}; do
echo "password required pam_pwquality.so" >> \
"/etc/authselect/custom/testingProfile/$file"
done

authselect apply-changes
{{% endif %}}
5 changes: 0 additions & 5 deletions product_properties/10-pwquality-conf.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
default:
pwquality_path: "/etc/security/pwquality.conf"

overrides:
{{% if product == 'sle16' %}}
pwquality_path: "/usr/lib/security/pwquality.conf"
{{% endif %}}
4 changes: 4 additions & 0 deletions shared/templates/accounts_password/ansible.template
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
{{{ ansible_ensure_pam_module_configuration('/etc/pam.d/common-password', 'password', 'requisite', 'pam_pwquality.so', '', '', 'BOF', rule_id=rule_id, rule_title=rule_title) }}}
{{% endif %}}

{{% if product == 'sle16' %}}
{{{ ansible_copy_distro_defaults('/usr/lib/security/pwquality.conf', pwquality_path, rule_title=rule_title) }}}
{{% endif %}}

- name: {{{ rule_title }}} - Ensure PAM variable {{{ VARIABLE }}} is set accordingly
ansible.builtin.lineinfile:
create: yes
Expand Down
4 changes: 4 additions & 0 deletions shared/templates/accounts_password/bash.template
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ fi
{{{ bash_ensure_pam_module_configuration('/etc/pam.d/common-password', 'password', 'requisite', 'pam_pwquality.so', '', '', 'BOF') }}}
{{% endif %}}

{{% if product == 'sle16' %}}
{{{ bash_copy_distro_defaults('/usr/lib/security/pwquality.conf', pwquality_path) }}}
{{% endif %}}

{{{ bash_replace_or_append(pwquality_path, '^' ~ VARIABLE , '$var_password_pam_' ~ VARIABLE , '%s = %s', cce_identifiers=cce_identifiers) }}}
Loading