0

I'm creating a playbook to update passwords on servers for Oracle patching. Like most password changes, you enter the command to change the password, enter the password and then again for verification.

I am able to update the passwords on Linux servers just fine using shell modules and expect statements (the user module didn't work out due to the second password verification prompt). The problem I'm running into is my ILOM servers don't run Linux (From the ILOM docs: The ILOM service processor (SP) runs its own embedded operating system and has a dedicated Ethernet port, which together provide out-of-band management capability. In addition, you can access ILOM from the server’s host operating system (Solaris, Linux, and Windows). Using ILOM, you can remotely manage your server as if you were using a locally attached keyboard, monitor, and mouse. ).

Like the docs say, I'm able to get into the server using delegate_to. I can run a debug on the server, it looks good and I can run the raw module to execute that first command but I'm not able to execute on that second password verification entry prompt. I tried chaining raw commands using && and ; but that didn't work. raw is the only module I've had any success with and just hoping this is a possibility without any heavy lifting.

Thank you!

Edit: This is the error message:

fatal: \[main server-> [ilom-server](https://ilom-server)\]: FAILED! => {
"changed": true,
"msg": "non-zero return code",
"rc": 2,
"stderr": "Shared connection to [ilom-server](https://ilom-server) closed.\\r\\n",
"stderr\_lines": \[
"Shared connection to [ilom-server](https://ilom-server) closed."
\],
"stdout": "Changing password for user /SP/users/root...\\r\\r\\nEnter new password again: \\r\\n\\r\\nConnection being closed due to 15 minutes of inactivity.\\r\\n\\r\\r\\n\\r\\n",
"stdout\_lines": \[
"Changing password for user /SP/users/root...",
"",
"Enter new password again: ",
"",
"Connection being closed due to 15 minutes of inactivity.",
"",
"",
""
\]
}
  • According the not further mentioned documentation it seems that if a task like `raw: set /SP/users/testuser password={{ NEW_PWD }} role=a` require the manual or human interaction to confirm the password change there is no possibibility for automatic or scripted changes. – U880D Jun 12 '23 at 21:16
  • But, you could give it a try with the `cli_command` module and according [Can the Ansible `raw` SSH module be used like `expect`?](https://stackoverflow.com/a/63798323/6771046). – U880D Jun 12 '23 at 21:43

0 Answers0