Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Unknown
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: knife-ec2
-
Labels:None
Description
The knife-ec2 plugin does not support an option for ssh_user, this is somewhat confusing as it seems like the regular bootstrap command can use this option.
It also does not support an option for security_groups, which makes it difficult to automate if you are not using default.
It could also use an option so you can pass in a runlist or a node_name for your EC2 Instance. Without this option it's not possible to easily create a plugin or script that launches EC2 Instances.
Related ticket: http://help.opscode.com/discussions/problems/1261-invalid-image-value-error-in-knife-exec
Issue Links
- is duplicated by
-
CHEF-1771
make knife ec2 support various flags in config file
-
My goal is to be able to write scripts around "knife ec2 server create" without actually having to execute the knife command line utility. I'm trying to understand the classes involved and do it through Ruby (e.g., Chef::Knife::Ec2ServerCreate).
In the related ticket (http://help.opscode.com/discussions/problems/1261-invalid-image-value-error-in-knife-exec), Jessica clarified that the only config options supported are:
However, many more options are available on the "knife ec2 server" command line. I can't find a way to access all options through Ruby code, but clearly "knife ec2 server create ..." has some way of doing it. How are we suppose to use these classes?
In my own attempts to answer this question, I've found different ways of going about the Chef::Knife::Ec2Server* classes. For example, in the docs there is this example on how to use Ec2ServerDelete within a knife exec script:
# Delete the Server delete_ec2 = Chef::Knife::Ec2ServerDelete.new() delete_ec2.name_args = [nodes.show(name)['ec2']['instance_id']] delete_ec2.runBut in the ticket, Jessica recommends using Chef::Config directly for Chef::Knife::Ec2ServerCreate.new. Example:
However, using this method I still can't make use of all of the options available on the command line.
How are we suppose to make use of these classes? What's the "official" API, if any? The code documentation is sparse (http://rubydoc.info/gems/knife-ec2/0.5.10/frames) and doesn't provide much direction.