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.
source share