Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line options not taking priority over knife configuration #328

Closed
yoshiwaan opened this issue Jul 9, 2015 · 4 comments
Closed

Comments

@yoshiwaan
Copy link

Hello,

I'm trying to spool an ec2 instance using knife ec2. I have the following set in my knife.rb

knife[:aws_ssh_key_id] = 'devop'

I am using a command similar to the following to spool up an instance:

/usr/bin/knife ec2 server create --image ami-1ecae776 --region us-east-1 --node-name asdf1234 --flavor m3.large --security-group-ids sg-asdf1234 --subnet subnet-asdf1234 --associate-public-ip --ebs-size 150 --ebs-volume-type gp2 --iam-profile webServer --bootstrap-version 12.4 --ssh-key dev --ssh-user ec2-user --identity-file ~/.ssh/dev.pem --secret-file ~/.chef/encrypted_data_bag_secret --run-list role[web-server] --environment development

Which produces the following output from knife:

Instance ID: i-95fc8946
Flavor: m3.large
Image: ami-1ecae776
Region: us-east-1
Availability Zone: us-east-1d
Security Group Ids: sg-asdf1234
IAM Profile: webServer
Tags: Name: asdf1234
SSH Key: devop

The keypair used in AWS is based on the value from knife.rb instead of a specifically defined command line parameter. Commenting out the line knife[:aws_ssh_key_id] = 'devop' in knife.rb yields the expected result, namely the keypair is set using the --ssh-key option.

The specific command line options should take precedence over knife.rb configuration options: https://tickets.opscode.com/browse/CHEF-1772
#247

I am using the latest version of Chef server.

@NimishaS
Copy link

@yoshiwaan, fix for this issue has been merged in master branch. Please verify.

@yoshiwaan
Copy link
Author

Sorry for the delay.

That seems to have done the trick.

On 17 July 2015 at 00:33, Nimisha Sharad [email protected] wrote:

@yoshiwaan https:/yoshiwaan, fix for this issue has been
merged in master branch. Please verify.


Reply to this email directly or view it on GitHub
#328 (comment).

@NimishaS NimishaS closed this as completed Aug 3, 2015
@yoshiwaan
Copy link
Author

Is this released as a gem yet?

@NimishaS
Copy link

NimishaS commented Aug 5, 2015

@yoshiwaan , this fix is not released yet. We'll have a release very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants