fix for: new ssh session is required after making user a sudoer without password

This commit is contained in:
ansgarz 2021-12-15 22:51:55 +01:00
parent 6385a9bb95
commit 835d777c90

View file

@ -69,6 +69,9 @@ private fun createProvInstanceRemote(
password != null, password != null,
{ "User ${prov.whoami()} not able to sudo on remote machine without password and no password available for the user." }) { "User ${prov.whoami()} not able to sudo on remote machine without password and no password available for the user." })
prov.makeUserSudoerWithNoSudoPasswordRequired(password) prov.makeUserSudoerWithNoSudoPasswordRequired(password)
// a new session is required after making the user a sudoer without password
return remote(host, remoteUser, password)
} else { } else {
throw IllegalStateException("User ${prov.whoami()} not able to sudo on remote machine without password and option not set to enable user to sudo without password.") throw IllegalStateException("User ${prov.whoami()} not able to sudo on remote machine without password and option not set to enable user to sudo without password.")
} }