Knife.rb aws configuration defaults


#1

As I have configured the aws_access_key_id in .chef/knife.rb as follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it, couldn’t found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for authentication
   --identity-file
-x, --ssh-user USERNAME          The ssh username
   --region REGION              Your AWS region

-G, --groups X,Y,Z The security groups for this server
-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for max verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


#2

Ec2 is a plugin for knife, so if you wanted to add more plugins, that shouldn’t be a problem.


Brad Knowles
Sent from my iPhone

On Feb 9, 2012, at 1:45 PM, Sachin Sagar Rai millisami@gmail.com wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it, couldn’t found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for authentication
   --identity-file
-x, --ssh-user USERNAME          The ssh username
   --region REGION              Your AWS region

-G, --groups X,Y,Z The security groups for this server
-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for max verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


#3

knife[:identity_file] # I’ve never seen it work though
knife[:region]
knife[:availability_zone]
knife[:aws_ssh_key_id]

Groups aren’t supported.

On Feb 9, 2012, at 1:45 PM, Sachin Sagar Rai wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it, couldn’t found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for authentication
   --identity-file
-x, --ssh-user USERNAME          The ssh username
   --region REGION              Your AWS region

-G, --groups X,Y,Z The security groups for this server
-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for max verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


#4

The options you mentioned are available in long form style:

On 10 February 2012 08:45, Sachin Sagar Rai millisami@gmail.com wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it, couldn’t
found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for

authentication

knife[:identity_file]

   --identity-file
-x, --ssh-user USERNAME          The ssh username

knife[:ssh_user]

   --region REGION              Your AWS region

knife[:region]

-G, --groups X,Y,Z The security groups for this server

knife[:groups]

etc.

–AJ

-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for max
verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


#5

There is actually an open bug about how knife[:identity_file] can’t be set
in knife.rb currently: http://tickets.opscode.com/browse/KNIFE_EC2-47

You can set this though by just adding the key to ssh, more information can
be found here in the wiki:
http://wiki.opscode.com/display/chef/Launch+Cloud+Instances+with+Knife#LaunchCloudInstanceswithKnife-SSHConfigurationIf
this is set, you do not need to provide an identity file to knife as
it
will automatically try this when connecting.

The knife-ec plugin’s readme has some good info on what can be set in the
knife.rb with this plugin as well:
https://github.com/opscode/knife-ec2/blob/master/README.rdoc

Jessica

On Thu, Feb 9, 2012 at 12:21 PM, AJ Christensen aj@junglist.gen.nz wrote:

The options you mentioned are available in long form style:

On 10 February 2012 08:45, Sachin Sagar Rai millisami@gmail.com wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as
follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it,
couldn’t

found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for

authentication

knife[:identity_file]

   --identity-file
-x, --ssh-user USERNAME          The ssh username

knife[:ssh_user]

   --region REGION              Your AWS region

knife[:region]

-G, --groups X,Y,Z The security groups for this server

knife[:groups]

etc.

–AJ

-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for
max

verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


#6

I think it’s not really a bug, it’s just the wrong way to set up at
the knife.rb file.

The EC2 plugin doesn’t take the ‘identity_file’ from
’knife[:identity_file]’ but ‘config[:identity_file]’, so it should be
defined like this at the knife.rb file:

identity_file “#{ENV[‘HOME’]}/.ssh/my_ec2_key.pub”

With your identity_file’s path, of course.

It should work for more attrs tha plugin need. Usually the attr name
is the long option, but without the ‘knife[:]’.

I hope this help.

On Thu, Feb 9, 2012 at 8:51 PM, Jessica Bourne jessica@opscode.com wrote:

There is actually an open bug about how knife[:identity_file] can’t be set
in knife.rb currently: http://tickets.opscode.com/browse/KNIFE_EC2-47

You can set this though by just adding the key to ssh, more information can
be found here in the
wiki: http://wiki.opscode.com/display/chef/Launch+Cloud+Instances+with+Knife#LaunchCloudInstanceswithKnife-SSHConfiguration
If this is set, you do not need to provide an identity file to knife as it
will automatically try this when connecting.

The knife-ec plugin’s readme has some good info on what can be set in the
knife.rb with this plugin as
well: https://github.com/opscode/knife-ec2/blob/master/README.rdoc

Jessica

On Thu, Feb 9, 2012 at 12:21 PM, AJ Christensen aj@junglist.gen.nz wrote:

The options you mentioned are available in long form style:

On 10 February 2012 08:45, Sachin Sagar Rai millisami@gmail.com wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as
follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it,
couldn’t
found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for

authentication

knife[:identity_file]

   --identity-file
-x, --ssh-user USERNAME          The ssh username

knife[:ssh_user]

   --region REGION              Your AWS region

knife[:region]

-G, --groups X,Y,Z The security groups for this server

knife[:groups]

etc.

–AJ

-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for
max
verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


Juanje


#7

@Juan
I put the following as u said in my knife.rb file

identity_file “#{current_dir}/keys/ror.pem”

It just hang on for password. When providing -i ~/chef-app/ror.pem it doesn’t ask.

I also tried the same for ssh_key “my-key” option, it also doesn’t work either.

Waiting for sshd…done
Bootstrapping Chef on ec2-23-20-60-46.compute-1.amazonaws.com
Failed to authenticate ubuntu - trying password auth
Enter your password:

So, I think its not supported yet with the knife-ec2 plugin.
Or did I do something wrong setup?


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

On Saturday, February 11, 2012 at 9:10 AM, Juan Jesús Ojeda Croissier wrote:

I think it’s not really a bug, it’s just the wrong way to set up at
the knife.rb file.

The EC2 plugin doesn’t take the ‘identity_file’ from
’knife[:identity_file]’ but ‘config[:identity_file]’, so it should be
defined like this at the knife.rb file:

identity_file “#{ENV[‘HOME’]}/.ssh/my_ec2_key.pub”

With your identity_file’s path, of course.

It should work for more attrs tha plugin need. Usually the attr name
is the long option, but without the ‘knife[:]’.

I hope this help.

On Thu, Feb 9, 2012 at 8:51 PM, Jessica Bourne <jessica@opscode.com (mailto:jessica@opscode.com)> wrote:

There is actually an open bug about how knife[:identity_file] can’t be set
in knife.rb currently: http://tickets.opscode.com/browse/KNIFE_EC2-47

You can set this though by just adding the key to ssh, more information can
be found here in the
wiki: http://wiki.opscode.com/display/chef/Launch+Cloud+Instances+with+Knife#LaunchCloudInstanceswithKnife-SSHConfiguration
If this is set, you do not need to provide an identity file to knife as it
will automatically try this when connecting.

The knife-ec plugin’s readme has some good info on what can be set in the
knife.rb with this plugin as
well: https://github.com/opscode/knife-ec2/blob/master/README.rdoc

Jessica

On Thu, Feb 9, 2012 at 12:21 PM, AJ Christensen <aj@junglist.gen.nz (mailto:aj@junglist.gen.nz)> wrote:

The options you mentioned are available in long form style:

On 10 February 2012 08:45, Sachin Sagar Rai <millisami@gmail.com (mailto:millisami@gmail.com)> wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as
follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it,
couldn’t
found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for

authentication

knife[:identity_file]

   --identity-file
-x, --ssh-user USERNAME          The ssh username

knife[:ssh_user]

   --region REGION              Your AWS region

knife[:region]

-G, --groups X,Y,Z The security groups for this server

knife[:groups]

etc.

–AJ

-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for
max
verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


Juanje


#8

On Sat, Feb 11, 2012 at 2:18 PM, Sachin Sagar Rai millisami@gmail.com wrote:

@Juan
I put the following as u said in my knife.rb file

identity_file “#{current_dir}/keys/ror.pem”

It just hang on for password. When providing -i ~/chef-app/ror.pem it
doesn’t ask.

Is the path ok?

I don’t know if you try like this but seems like you used different
path for each option:

at the knife.rb:
"#{current_dir}/keys/ror.pem"

at the command option:
~/chef-app/ror.pem

They don’t seems to be the same path. Could you chek it?

I also tried the same for ssh_key “my-key” option, it also doesn’t work
either.

Waiting for sshd…done
Bootstrapping Chef on ec2-23-20-60-46.compute-1.amazonaws.com
Failed to authenticate ubuntu - trying password auth
Enter your password:

It seems that it actually try to use the key but it didn’t work (maybe
because the path was wrong), so it try a failback option (with
password).

So, I think its not supported yet with the knife-ec2 plugin.
Or did I do something wrong setup?

Could be… I have not ec2 account to try now, but looking at the code
it seems like it should work. And the fail message that give it to you
looks like it is trying to use the key.
Could you check the path to see if that was the problem?
Thanks

On Saturday, February 11, 2012 at 9:10 AM, Juan Jesús Ojeda Croissier wrote:

I think it’s not really a bug, it’s just the wrong way to set up at
the knife.rb file.

The EC2 plugin doesn’t take the ‘identity_file’ from
’knife[:identity_file]’ but ‘config[:identity_file]’, so it should be
defined like this at the knife.rb file:

identity_file “#{ENV[‘HOME’]}/.ssh/my_ec2_key.pub”

With your identity_file’s path, of course.

It should work for more attrs tha plugin need. Usually the attr name
is the long option, but without the ‘knife[:]’.

I hope this help.

On Thu, Feb 9, 2012 at 8:51 PM, Jessica Bourne jessica@opscode.com wrote:

There is actually an open bug about how knife[:identity_file] can’t be set
in knife.rb currently: http://tickets.opscode.com/browse/KNIFE_EC2-47

You can set this though by just adding the key to ssh, more information can
be found here in the
wiki: http://wiki.opscode.com/display/chef/Launch+Cloud+Instances+with+Knife#LaunchCloudInstanceswithKnife-SSHConfiguration
If this is set, you do not need to provide an identity file to knife as it
will automatically try this when connecting.

The knife-ec plugin’s readme has some good info on what can be set in the
knife.rb with this plugin as
well: https://github.com/opscode/knife-ec2/blob/master/README.rdoc

Jessica

On Thu, Feb 9, 2012 at 12:21 PM, AJ Christensen aj@junglist.gen.nz wrote:

The options you mentioned are available in long form style:

On 10 February 2012 08:45, Sachin Sagar Rai millisami@gmail.com wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as
follows:

knife[:aws_access_key_id] = "SSSSS"

What are the equivalent for the following options? I googled it,
couldn’t
found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE,                The SSH identity file used for

authentication

knife[:identity_file]

   --identity-file
-x, --ssh-user USERNAME          The ssh username

knife[:ssh_user]

   --region REGION              Your AWS region

knife[:region]

-G, --groups X,Y,Z The security groups for this server

knife[:groups]

etc.

–AJ

-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for
max
verbosity


@millisami
~ Sachin Sagar Rai
Ruby on Rails Developer
http://tfm.com.np
http://nepalonrails.tumblr.com
Sent with Sparrow


Juanje


Juanje


#9

Ohai!

This still only exists in a gist, but we do have a task internally to get this documented in some more visible form.

On Thursday, February 9, 2012 at 12:45 PM, Sachin Sagar Rai wrote:

As I have configured the aws_access_key_id in .chef/knife.rb as follows:

knife[:aws_access_key_id] = “SSSSS”

What are the equivalent for the following options? I googled it, couldn’t found the precise one. Does knife ec2 plugin support?

-i IDENTITY_FILE, The SSH identity file used for authentication
–identity-file
-x, --ssh-user USERNAME The ssh username
–region REGION Your AWS region
-G, --groups X,Y,Z The security groups for this server
-S, --ssh-key KEY The AWS SSH key id
-V, --verbose More verbose output. Use twice for max verbosity


Opscode, Inc.
Joshua Timberman, Technical Program Manager
IRC, Skype, Twitter, Github: jtimberman