问题
I'm trying to get knife-vsphere working in my vCenter environment. I have a script working that spins up a VM from a template then bootstraps it and runs cookbook recipes to completion. However, I get prompted to supply a sudo password. Is this expected? I supplied the '--ssh-user' and '--ssh-password' params and, upon being prompted, I'm typing the same password in and then chef build continues.
isn't there a way to make this hands off? what may I have missed?
Thanks!
回答1:
As pointed out in the comments, it was the OS (not Chef or knife) that was prompting for sudo. Don't want that, you have to configure the user in the template to not be prompted for passwords when using sudo.
https://askubuntu.com/questions/192050/how-to-run-sudo-command-with-no-password
Thanks rhashimoto.
来源:https://stackoverflow.com/questions/30561953/why-am-i-getting-prompted-for-sudo-password-via-knife-vsphere-when-giving-ssh