How to skip inaccessible nodes when using the ssh knife

I am trying to run a shell command on multiple nodes using knife ssh as follows:

 knife ssh -V "role:web" --ssh-gateway ec2-user@aws _ssh_gateway \ --ssh-user ubuntu \ "sudo chef-client" 

It works fine when all my instances with the web role are at the top, but when I remove only one instance, this command hangs with this message:

 WARNING: Failed to connect to -- Net::SSH::Disconnect: connection closed by remote host 

Is there any way to tell the knife to simply skip inaccessible nodes and continue working with those that are raised?

UPDATE: the knife should skip inaccessible nodes by default, but this does not happen. A possible reason is the SSH gateway. Exploring.

+4
source share
1 answer

Starting with Chef 11, the knife will simply warn and skip inaccessible nodes automatically.

+1
source

Source: https://habr.com/ru/post/1497808/


All Articles