Skip to content

Commit

Permalink
user: check for password with byte size of 16 and 20
Browse files Browse the repository at this point in the history
  • Loading branch information
b4ldr committed Mar 14, 2024
1 parent b994667 commit 8c40b75
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions manifests/user.pp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,19 @@
notify => [Exec["ipmi_user_enable_${title}"], Exec["ipmi_user_enable_sol_${title}"], Exec["ipmi_user_channel_setaccess_${title}"]],
}

$unless_cmd = @("CMD"/L$)
/usr/bin/ipmitool user test ${user_id} 16 "\$PASSWORD" ||
/usr/bin/ipmitool user test ${user_id} 20 "\$PASSWORD"
|- CMD
exec { "ipmi_user_setpw_${title}":
environment => ["PASSWORD=${real_password}"],
command => "/usr/bin/ipmitool user set password ${user_id} \"\$PASSWORD\"",
unless => "/usr/bin/ipmitool user test ${user_id} 16 \"\$PASSWORD\"",
notify => [Exec["ipmi_user_enable_${title}"], Exec["ipmi_user_enable_sol_${title}"], Exec["ipmi_user_channel_setaccess_${title}"]],
unless => $unless_cmd,
notify => Exec[
"ipmi_user_enable_${title}",
"ipmi_user_enable_sol_${title}",
"ipmi_user_channel_setaccess_${title}"
],
}

exec { "ipmi_user_enable_sol_${title}":
Expand Down

0 comments on commit 8c40b75

Please sign in to comment.