Fix first password change in Ansible for Debian

For Debian, when the user is prompted to change the password on first
login, the strings printed are different from CentOS: Debian prints
"Current password" while CentOS prints "(current) UNIX password". This
difference cause some Ansible tasks that change password to fail. The
same problem was corrected for LDAP in
https://review.opendev.org/c/starlingx/ansible-playbooks/+/863699 .

One of the cases where the password is changed by Ansible tasks is
during bootstrap of a subcloud using Redfish Platform Management
Service.

Test Plan:

PASS: Successfully bootstrap a subcloud using Redfish, checking in the
Ansible log that the first password was successfully changed.

Closes-Bug: 1996196
Signed-off-by: Joao Victor Portal <Joao.VictorPortal@windriver.com>
Change-Id: Id3b47224ceb66f834356a37c5746ca1890f6b6bb
This commit is contained in:
Joao Victor Portal 2022-11-07 18:34:43 -03:00 committed by João Victor Portal
parent f237a8a3e0
commit 2b875db573
5 changed files with 14 additions and 0 deletions

View File

@ -18,6 +18,7 @@ vault_password_change_responses:
yes/no: 'yes'
sysadmin*: 'sysadmin'
\(current\) UNIX password: 'sysadmin'
Current password: 'sysadmin'
(?i)New password: 'Boot5trap*'
(?i)Retype new password: 'Boot5trap*'

View File

@ -23,10 +23,14 @@ admin_password: St8rlingX*
#
password_change: false
# The expected password strings differ between CentOS and Debian. The string
# "(current) UNIX password" is found only in CentOS, while the string "Current
# Password" is found only in Debian.
password_change_responses:
yes/no: 'yes'
sysadmin*: 'sysadmin'
\(current\) UNIX password: 'sysadmin'
Current password: 'sysadmin'
(?i)New password: 'St8rlingX*'
(?i)Retype new password: 'St8rlingX*'

View File

@ -394,10 +394,14 @@ admin_password: St8rlingX*
#
password_change: false
# The expected password strings differ between CentOS and Debian. The string
# "(current) UNIX password" is found only in CentOS, while the string "Current
# Password" is found only in Debian.
password_change_responses:
yes/no: 'yes'
sysadmin*: 'sysadmin'
\(current\) UNIX password: 'sysadmin'
Current password: 'sysadmin'
(?i)New password: 'St8rlingX*'
(?i)Retype new password: 'St8rlingX*'

View File

@ -12,10 +12,14 @@
#
password_change: false
# The expected password strings differ between CentOS and Debian. The string
# "(current) UNIX password" is found only in CentOS, while the string "Current
# Password" is found only in Debian.
password_change_responses:
yes/no: 'yes'
sysadmin*: 'sysadmin'
\(current\) UNIX password: 'sysadmin'
Current password: 'sysadmin'
(?i)New password: 'St8rlingX*'
(?i)Retype new password: 'St8rlingX*'

View File

@ -23,6 +23,7 @@
yes/no: 'yes'
sysadmin*: 'sysadmin'
\(current\) UNIX password: 'sysadmin'
Current password: 'sysadmin'
(?i)New password: "{{ ansible_ssh_pass }}"
(?i)Retype new password: "{{ ansible_ssh_pass }}"