Skip to content

Commit

Permalink
Update set_password_hashing_algorithm_logindefs for Ubuntu 24.04
Browse files Browse the repository at this point in the history
  • Loading branch information
ericeberry committed Nov 26, 2024
1 parent 0c15877 commit 4851d0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
lineinfile:
dest: /etc/login.defs
regexp: ^#?ENCRYPT_METHOD
line: ENCRYPT_METHOD {{ var_password_hashing_algorithm }}
line: ENCRYPT_METHOD {{ var_password_hashing_algorithm.split('|')[0] }}
state: present
create: yes
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# platform = multi_platform_all

{{{ bash_instantiate_variables("var_password_hashing_algorithm") }}}

# Allow multiple algorithms, but choose the first one for remediation
#
var_password_hashing_algorithm="$(echo $var_password_hashing_algorithm | cut -d \| -f 1)"

{{{ bash_replace_or_append('/etc/login.defs', '^ENCRYPT_METHOD', "$var_password_hashing_algorithm", '%s %s') }}}

0 comments on commit 4851d0e

Please sign in to comment.