Create New Cookbook and New Role

 

 

Logging Into the Chef-Workstation:
#ssh -i /sshkey root@22.22.22.22

Always work inside the chef repo directory.
#cd /root/chef-repo

Command to create new cookbook
#knife cookbook create mynewcookbook

Putup the ruby codes into the recipe of the new cookbook
#vim /root/chef-repo/cookbooks/mynewcookbook/recipes/default.rb

Upload the cookbook to the Platform
#knife cookbook upload mynewcookbook

Now start the instance using chef on EC2!!!
#knife ec2 server create -G default -I ami-33333 -f m1.small -S AWS_SSH_key_id -i /root/key -x root -r ‘role[rolename]’

[NOTE : If Chef-ec2 api is configured]

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s