pstadler / flightplan

Run sequences of shell commands against local and remote hosts.
https://www.npmjs.com/package/flightplan
MIT License
1.82k stars 116 forks source link

Ignore SSH connection failures #92

Closed ravi closed 9 years ago

ravi commented 9 years ago

This would be a very useful feature: When running a flight plan across a bunch of hosts, report and ignore any per host connection errors. IOW, if the plan cannot be run on one server because the SSH connection failed, do not abort the entire run.

pstadler commented 9 years ago

0.6.4 enables you to set a failsafe flag on any host to allow this host's connection to fail:

plan.target('production', [
  {
    host: 'www1.example.com',
    username: 'pstadler',
    agent: process.env.SSH_AUTH_SOCK
  },
  {
    host: 'www2.example.com',
    username: 'pstadler',
    agent: process.env.SSH_AUTH_SOCK,
    failsafe: true // continue flightplan even if connection to www2 fails
  }
]);

Docs: https://github.com/pstadler/flightplan#flightplantargetname-hosts-options--this

ravi commented 9 years ago

Great! Thank you.

ravi commented 8 years ago

@pstadler Is there a way to collect such failures programmatically (so they could be reported at the end, for instance)? A cursory scan of the code tells me the answer is 'no', but I wanted to be sure. Thank you.

pstadler commented 8 years ago

Unfortunately, there's currently no way of catching errors that happen during connection.

ravi commented 8 years ago

Okay thank you!