Passing on_error config to knife ssh


#1

We are using knife ssh to trigger simultaneous chef-client runs across multiple
instances present in AWS. However whenever the IP address of an EC2 instance
changes, the resulting chef search returns older IP addresses which effectively
lead to a warning indicating that it failed to connect to the instance.

WARNING: Failed to connect to – Errno::ETIMEDOUT: Connection timed out -
connect(2)

Ideally I’d like to set the on_error knife ssh config variable to :raise
instead of :skip so that knife ssh fails with a non-zero exit code. How do I go
about setting this config attribute? Is it possible to set this in knife.rb?


#2

Should I instead open a ticket and send a pull request to allow the
on_error config attribute to be overridden using a command line parameter ?

Thanks,
Anay

On Mon, Aug 5, 2013 at 7:52 PM, anayak007@gmail.com wrote:

We are using knife ssh to trigger simultaneous chef-client runs across
multiple
instances present in AWS. However whenever the IP address of an EC2
instance
changes, the resulting chef search returns older IP addresses which
effectively
lead to a warning indicating that it failed to connect to the instance.

WARNING: Failed to connect to – Errno::ETIMEDOUT: Connection timed out -
connect(2)

Ideally I’d like to set the on_error knife ssh config variable to :raise
instead of :skip so that knife ssh fails with a non-zero exit code. How do
I go
about setting this config attribute? Is it possible to set this in
knife.rb?


#3

On Tuesday, August 6, 2013 at 8:29 AM, Anay Nayak wrote:

Should I instead open a ticket and send a pull request to allow the on_error config attribute to be overridden using a command line parameter ?

Thanks,
Anay

If you need this feature, then yes, open a ticket and submit a pull request.

Thanks,


Daniel DeLeo