# Default attribute for knife ssh in the clouds?

**URL:** <https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963>\
**Category:** Chef Infra (archive)\
**Created:** [July 26, 2012, 7:14pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963 "2012-07-26T19:14:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bryan\_McLellan](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/bryan_mclellan/32/81_2.png) [@Bryan\_McLellan](https://discourse.chef.io/u/Bryan_McLellan)\
**Post date:** [July 26, 2012, 7:14pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/1 "2012-07-26T19:14:17Z")

</div>

Historically (since CHEF-922) when using ‘knife ssh’ to connect to an  
EC2 system, you passed “-a ec2.public\_hostname” to specify what  
attribute to get the address from.

CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
[:cloud] is populated. It currently falls back on  
(Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || “fqdn”)  
if cloud is not. I think this would prevent you from being able to  
override, which isn’t acceptable. Provided that is fixed, what’s  
everyone think about changing the default along the lines of this  
proposal?

Bryan

[1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)

---

<div class="post-metadata">

**Author:** ![adfasdfasdfasdf](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@adfasdfasdfasdf](https://discourse.chef.io/u/adfasdfasdfasdf)\
**Post date:** [July 26, 2012, 7:43pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/2 "2012-07-26T19:43:24Z")

</div>

On 26/07/2012 20:14, Bryan McLellan wrote:

> Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> attribute to get the address from.
> 
> CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> [:cloud] is populated. It currently falls back on  
> (Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || "fqdn")  
> if cloud is not. I think this would prevent you from being able to  
> override, which isn't acceptable. Provided that is fixed, what's  
> everyone think about changing the default along the lines of this  
> proposal?
> 
> Bryan
> 
> [1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)  
> +1

Works for me as long, as long you can override it. As you say, being  
unable to override would be a showstopper. It was bad enough not being  
able to override settings from knife.rb.

Cheers  
Nick

---

<div class="post-metadata">

**Author:** ![Denis\_Haskin1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/denis_haskin1/32/584_2.png) [@Denis\_Haskin1](https://discourse.chef.io/u/Denis_Haskin1)\
**Post date:** [July 26, 2012, 7:49pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/3 "2012-07-26T19:49:44Z")

</div>

Also +1

--  
Denis Haskin  
cell: 781-258-7414

On Thu, Jul 26, 2012 at 3:43 PM, Nick Peirson [nickpeirson@gmail.com](mailto:nickpeirson@gmail.com) wrote:

> On 26/07/2012 20:14, Bryan McLellan wrote:
> 
> > Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> > EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> > attribute to get the address from.
> > 
> > CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> > [:cloud] is populated. It currently falls back on  
> > (Chef::Config[:knife][:ssh\_\*\*attribute] || config[:attribute] || "fqdn")  
> > if cloud is not. I think this would prevent you from being able to  
> > override, which isn't acceptable. Provided that is fixed, what's  
> > everyone think about changing the default along the lines of this  
> > proposal?
> > 
> > Bryan
> > 
> > [1] [http://tickets.opscode.com/\*\*browse/CHEF-1554](http://tickets.opscode.com/**browse/CHEF-1554)[http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)
> 
> +1
> 
> Works for me as long, as long you can override it. As you say, being  
> unable to override would be a showstopper. It was bad enough not being able  
> to override settings from knife.rb.
> 
> Cheers  
> Nick

---

<div class="post-metadata">

**Author:** ![Steven\_Danna](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steven_danna/32/195_2.png) [@Steven\_Danna](https://discourse.chef.io/u/Steven_Danna)\
**Post date:** [July 26, 2012, 8:51pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/4 "2012-07-26T20:51:21Z")

</div>

As long as you can override, +1 here. This often confuses people  
starting out.

On Thu, Jul 26, 2012 at 12:49 PM, Denis Haskin [denis@constantorbit.com](mailto:denis@constantorbit.com) wrote:

> Also +1
> 
> --  
> Denis Haskin  
> cell: 781-258-7414
> 
> On Thu, Jul 26, 2012 at 3:43 PM, Nick Peirson [nickpeirson@gmail.com](mailto:nickpeirson@gmail.com) wrote:
> 
> > On 26/07/2012 20:14, Bryan McLellan wrote:
> > 
> > > Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> > > EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> > > attribute to get the address from.
> > > 
> > > CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> > > [:cloud] is populated. It currently falls back on  
> > > (Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || "fqdn")  
> > > if cloud is not. I think this would prevent you from being able to  
> > > override, which isn't acceptable. Provided that is fixed, what's  
> > > everyone think about changing the default along the lines of this  
> > > proposal?
> > > 
> > > Bryan
> > > 
> > > [1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)
> > 
> > +1
> > 
> > Works for me as long, as long you can override it. As you say, being  
> > unable to override would be a showstopper. It was bad enough not being able  
> > to override settings from knife.rb.
> > 
> > Cheers  
> > Nick

---

<div class="post-metadata">

**Author:** ![Robby\_Grossman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/robby_grossman/32/685_2.png) [@Robby\_Grossman](https://discourse.chef.io/u/Robby_Grossman)\
**Post date:** [July 26, 2012, 8:59pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/5 "2012-07-26T20:59:36Z")

</div>

+1 here as well.

Even if we drop the automatic cloud detection, implementing the ssh\_attribute check via knife config would be super easy and DRY.

--  
Robby Grossman  
@freerobby ([http://twitter.com/freerobby](http://twitter.com/freerobby))  
[http://rob.by](http://rob.by) ([http://rob.by/](http://rob.by/))

On Thursday, July 26, 2012 at 4:51 PM, Steven Danna wrote:

> As long as you can override, +1 here. This often confuses people  
> starting out.
> 
> On Thu, Jul 26, 2012 at 12:49 PM, Denis Haskin \<[denis@constantorbit.com](mailto:denis@constantorbit.com) ([mailto:denis@constantorbit.com](mailto:denis@constantorbit.com))\> wrote:
> 
> > Also +1
> > 
> > --  
> > Denis Haskin  
> > cell: 781-258-7414
> > 
> > On Thu, Jul 26, 2012 at 3:43 PM, Nick Peirson \<[nickpeirson@gmail.com](mailto:nickpeirson@gmail.com) ([mailto:nickpeirson@gmail.com](mailto:nickpeirson@gmail.com))\> wrote:
> > 
> > > On 26/07/2012 20:14, Bryan McLellan wrote:
> > > 
> > > > Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> > > > EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> > > > attribute to get the address from.
> > > > 
> > > > CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> > > > [:cloud] is populated. It currently falls back on  
> > > > (Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || "fqdn")  
> > > > if cloud is not. I think this would prevent you from being able to  
> > > > override, which isn't acceptable. Provided that is fixed, what's  
> > > > everyone think about changing the default along the lines of this  
> > > > proposal?
> > > > 
> > > > Bryan
> > > > 
> > > > [1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)
> > > 
> > > +1
> > > 
> > > Works for me as long, as long you can override it. As you say, being  
> > > unable to override would be a showstopper. It was bad enough not being able  
> > > to override settings from knife.rb.
> > > 
> > > Cheers  
> > > Nick

---

<div class="post-metadata">

**Author:** ![J\_Light](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/j_light/32/412_2.png) [@J\_Light](https://discourse.chef.io/u/J_Light)\
**Post date:** [July 26, 2012, 9:07pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/6 "2012-07-26T21:07:27Z")

</div>

Agreed. This confused me at first for sure.  
CHEF-1554.num\_supporters += 1

On Thu, Jul 26, 2012 at 4:59 PM, Robby Grossman [robby@freerobby.com](mailto:robby@freerobby.com) wrote:

> +1 here as well.
> 
> Even if we drop the automatic cloud detection, implementing the  
> ssh\_attribute check via knife config would be super easy and DRY.
> 
> --  
> Robby Grossman  
> @freerobby  
> [http://rob.by](http://rob.by)
> 
> On Thursday, July 26, 2012 at 4:51 PM, Steven Danna wrote:
> 
> As long as you can override, +1 here. This often confuses people  
> starting out.
> 
> On Thu, Jul 26, 2012 at 12:49 PM, Denis Haskin [denis@constantorbit.com](mailto:denis@constantorbit.com)  
> wrote:
> 
> Also +1
> 
> --  
> Denis Haskin  
> cell: 781-258-7414
> 
> On Thu, Jul 26, 2012 at 3:43 PM, Nick Peirson [nickpeirson@gmail.com](mailto:nickpeirson@gmail.com) wrote:
> 
> On 26/07/2012 20:14, Bryan McLellan wrote:
> 
> Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> attribute to get the address from.
> 
> CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> [:cloud] is populated. It currently falls back on  
> (Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || "fqdn")  
> if cloud is not. I think this would prevent you from being able to  
> override, which isn't acceptable. Provided that is fixed, what's  
> everyone think about changing the default along the lines of this  
> proposal?
> 
> Bryan
> 
> [1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)
> 
> +1
> 
> Works for me as long, as long you can override it. As you say, being  
> unable to override would be a showstopper. It was bad enough not being able  
> to override settings from knife.rb.
> 
> Cheers  
> Nick

---

<div class="post-metadata">

**Author:** ![J\_Light](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/j_light/32/412_2.png) [@J\_Light](https://discourse.chef.io/u/J_Light)\
**Post date:** [July 26, 2012, 9:08pm UTC](https://discourse.chef.io/t/default-attribute-for-knife-ssh-in-the-clouds/2963/7 "2012-07-26T21:08:22Z")

</div>

Ah, sorry for the double response. I got an error from the list that  
my response wasn't accepted the first time then didn't see it show up.

On Thu, Jul 26, 2012 at 5:07 PM, James Light [j.gareth.light@gmail.com](mailto:j.gareth.light@gmail.com) wrote:

> Agreed. This confused me at first for sure.  
> CHEF-1554.num\_supporters += 1
> 
> On Thu, Jul 26, 2012 at 4:59 PM, Robby Grossman [robby@freerobby.com](mailto:robby@freerobby.com) wrote:
> 
> > +1 here as well.
> > 
> > Even if we drop the automatic cloud detection, implementing the  
> > ssh\_attribute check via knife config would be super easy and DRY.
> > 
> > --  
> > Robby Grossman  
> > @freerobby  
> > [http://rob.by](http://rob.by)
> > 
> > On Thursday, July 26, 2012 at 4:51 PM, Steven Danna wrote:
> > 
> > As long as you can override, +1 here. This often confuses people  
> > starting out.
> > 
> > On Thu, Jul 26, 2012 at 12:49 PM, Denis Haskin [denis@constantorbit.com](mailto:denis@constantorbit.com)  
> > wrote:
> > 
> > Also +1
> > 
> > --  
> > Denis Haskin  
> > cell: 781-258-7414
> > 
> > On Thu, Jul 26, 2012 at 3:43 PM, Nick Peirson [nickpeirson@gmail.com](mailto:nickpeirson@gmail.com) wrote:
> > 
> > On 26/07/2012 20:14, Bryan McLellan wrote:
> > 
> > Historically (since CHEF-922) when using 'knife ssh' to connect to an  
> > EC2 system, you passed "-a ec2.public\_hostname" to specify what  
> > attribute to get the address from.
> > 
> > CHEF-1554 [1] proposes to use node[:cloud][:public\_hostname] is  
> > [:cloud] is populated. It currently falls back on  
> > (Chef::Config[:knife][:ssh\_attribute] || config[:attribute] || "fqdn")  
> > if cloud is not. I think this would prevent you from being able to  
> > override, which isn't acceptable. Provided that is fixed, what's  
> > everyone think about changing the default along the lines of this  
> > proposal?
> > 
> > Bryan
> > 
> > [1] [http://tickets.opscode.com/browse/CHEF-1554](http://tickets.opscode.com/browse/CHEF-1554)
> > 
> > +1
> > 
> > Works for me as long, as long you can override it. As you say, being  
> > unable to override would be a showstopper. It was bad enough not being able  
> > to override settings from knife.rb.
> > 
> > Cheers  
> > Nick
