I'm trying to run a shell command on multiple nodes using knife ssh
in a following way:
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 role "web" are up, but when I take down only one instance this command hangs with this message:
WARNING: Failed to connect to -- Net::SSH::Disconnect: connection closed by remote host
Is there a way to tell knife to just skip unreachable nodes and continue with ones that are up?
UPDATE: Knife should skip unreachable nodes by default but this does not happen. Possible reason is SSH gateway. Investigating.
As of Chef 11, knife will just warn and skip unreachable nodes automatically.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With