I got my Chef Server and Chef workstation configured on an AWS VM running Centos. I downloaded the chef-repo from GitHub as per the instructions.
I downloaded the keys from my Chef Server. I also had keys from Amazon to use their EC2 API (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY). I also created a key at Amazon for use with the instance (test.pem). All the keys are in ~chef-repo/.chef/ and in ~/.ssh/.
I am trying to bootstrap an existing ec2 instance in a specific environment and under a specific role.
Hello Jyoti,
If you were able to bootstrap the node at all, then all is well with the
keys you have in your .chef and .ssh directories, and your AWS API keys
likely have nothing to do with your issue, either.
It looks like you're doing three things with your bootstrap command:
Name the node "Centos_Node"
Add the "web_server" role to its run list
Set the environment to "testing"
So here's what I'm wondering:
Do step #1 and #2 above take effect normally, i.e. once bootstrapping is
complete, is the node indeed called "Centos_Node" and does its run list
contain the web_server role and its dependents (if any)?
Did you double-check that you did, in fact, create an environment called
"testing" and upload it to the Chef Server? You may have created it but
never uploaded it. If the environment you specify in the bootstrap command
does not exist on the Chef Server, then it won't get assigned to the node.
You can check if the environment exists simply by typing:
$ knife environment list
If it's not there, create testing.rb in ~/chef-repo/environments. You could
start with a single line in it:
name 'testing'
You can refer to http://docs.opscode.com/essentials_environments.html to
create environments.
Once the environment exists on your workstation, type:
$ knife environment from file testing.rb
Then check again if the environment now exists on the server, and then you
should be able to assign it to your node.
I got my Chef Server and Chef workstation configured on an AWS VM running
Centos. I downloaded the chef-repo from GitHub as per the instructions.
I downloaded the keys from my Chef Server. I also had keys from Amazon to
use their EC2 API (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY). I also
created a key at Amazon for use with the instance (test.pem). All the keys
are in ~chef-repo/.chef/ and in ~/.ssh/.
I am trying to bootstrap an existing ec2 instance in a specific
environment and under a specific role.