Force Bootstrap (Auto Answer Questions)


How would I go about forcing Bootstrap of a remote node dispite getting questioned? i.e.

knife bootstrap windows winrm '[IP]' -N '[NODENAME]' -x '[USERNAME]' -P '[PASSWORD]' --bootstrap-install-command 'msiexec /i [URL]'

Node [NODENAME] exists, overwrite it? (Y/N) y
Client [NODENAME] exists, overwrite it? (Y/N) y

I just want CHEF to auto answer the question with a 'Y' so that I can automate this within Terraform.

Let me know what the correct syntax is to accomplish this.

Thank you,

The -y flag will allow you to do what you want.

1 Like

knife bootstrap windows winrm '[IP]' -N '[NODENAME]' -x '[USERNAME]' -P '[PASSWORD]' --bootstrap-install-command 'msiexec /i [URL]' -y

So the syntax looks like that above?

Correct. Since you're running knife, you could also (potentially) delete the node ahead of time by running:

knife node delete [NODENAME] -y
knife client delete [NODENAME] -y

But adding the -y flag to your bootstrap command is probably easier.

1 Like