[chef] Re: Re: Help in how to add nodes to different environments


Chronological Thread 
  • From: Venkat Chowdhary < >
  • To: " " < >
  • Subject: [chef] Re: Re: Help in how to add nodes to different environments
  • Date: Mon, 17 Mar 2014 23:34:36 +0800 (SGT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.co.in; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=bF11mE/R4pBemI87ON0ZIiWFVOlq/hJUa9dlYGij7RcyDoHBf4q+AgDEoRPNU/gh3JFocQSdvUkOm5WGOl60VG+o4dCt5qUEjNH/KAs3tPfvCf0H75/COiEZUy+OpDvR+lAOeiXBP0uN8bL9ArVdgChTkF4vFVm6cfcOGO3KMXI=;

Thanks Jeff, Your help is highly appreciable.

Yes, its better if we can able to manage it through a config file. I am still searching how to do using config file.
 
Thanks & Regards
Venkat


On Monday, 17 March 2014 8:51 PM, Jeff Byrnes < > wrote:
The environment is set when converging the node. With a Chef Server, you’d set it on the initial bootstrap, and it would stick moving forward from there.

With chef-solo, you run the chef-solo command on each particular instance. You’ll need to either specify a config file that provides the values for the particular node you’re bootstrapping, or set the environment directly in the chef-solo command using the environment flag (-E or --environment).

E.g., sudo chef-solo -E prod -N my-new-node -o role[my-new-role]

Might need some quotes in there, but that’s kind of the idea. Others might have more experience in this realm, however.

See the docs on Chef Solo, specifically here: http://docs.opscode.com/chef_solo.html#chef-solo-executable for full details on the arguments it takes.

It’d probably be easier to deploy a config file particular to each node as part of your deployment process, and tell Chef Solo to read that config file, instead of specifying things in the command itself. E.g., sudo chef-solo -c ~/chef/solo.rb
-- 
Jeff Byrnes
@berkleebassist
Operations Engineer
704.516.4628

Hi  

   I am using chef-solo. I am creating environments (dev.json) manually like below:

{
  "name": "dev",
  "description": "Development Environment",
  "cookbook_versions": {
  },
  "json_class": "Chef::Environment",
  "chef_type": "environment",
  "default_attributes": {
  },
  "override_attributes": {
  }
}

Could you please help me how to add nodes to different environments like (dev, staging, production etc ...)

Your help is highly appreciable.

Thanks in advance.

Thanks & Regards
Venkat





Archive powered by MHonArc 2.6.16.

§