[chef] Re: Re: Re: Re: passing attributes to recipes


Chronological Thread 
  • From: Juan Jesús Ojeda Croissier < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: passing attributes to recipes
  • Date: Sat, 11 Feb 2012 01:33:51 +0000

Aha...

I imagined that. I ask you because what the wiki says as a 'file' method seems to suggest that you can do it by using 'rake install':

"""
The Ruby DSL

Environments created through this mechanism get compiled to JSON, and then are loaded in to the Chef Server. (We never execute ruby code directly on the chef server!) Each time you rake install your Chef Repository, we will re-compile the corresponding JSON and store it in the chef server.

You should create these files in the 'environments' subdirectory of your chef repository. If your repository doesn't have this directory, create it now. Each DSL file should have a .rb suffix.

...

"""

I think it should be more clear (or add the task to the Rake...) at the wiki.


On Sat, Feb 11, 2012 at 1:11 AM, Max Gorbul < "> > wrote:
I use "knife <thing> from file <filename>.<(rb|json)>"

example: 
knife role from file my-awesome-role.rb
knife environment from file production.rb
knife data bag from file usesr max.json

I have never used rake tasks you mentioned.

--max


2012/2/10 Juan Jesús Ojeda Croissier < " target="_blank"> >
Hi Max,

What do you use for upload the environment with the files method?
I tried as the wiki says but 'rake install' doesn't look for the environments. Actually, I was checking the code (chef/tasks/chef_repo.rake) and it doesn't do  anything with environments...

I tried with 'knife environment from file entiroments/new_env.rb' and work perfect, but it doesn't need to be tracked by git at your repo so is up to you to track it.

Did I miss something?

Thanks :-)

On Thu, Feb 9, 2012 at 5:48 PM, Max Gorbul < " target="_blank"> > wrote:
Of course you can override attributes per role/environment.
http://wiki.opscode.com/display/chef/Roles

there are sever ways to manage those things
1. files
2. knife
3. chef server web ui

I prefer the first one. Because all your changes are being tracked by git.

Thank you,
Max


On Thu, Feb 9, 2012 at 9:41 AM, Steffen Fricke < " target="_blank"> > wrote:

Hello,

 

 

I’m relatively new to chef and I try to figure out, how to pass variable attributes like build file names or build numbers to chef recipes. So the best would be if I could add/overwrite a given attribute in a role/environment by it to knife via command line like: knife environment edit [env_name] “attribute_key=attribute_value”.

 

Is there a recommended way of doing that?

 

Thanks in advance,

Steffen

 

Description: adobe_logo_web

Steffen Fricke
Software QE Developer


Adobe Systems Engineering GmbH

49.40.3063.6454

" target="_blank">

Grosse Elbstr. 27
22767 Hamburg, Germany

www.adobe.com

 

 

Registergericht: Hamburg HRB 745 37

Geschäftsführer: Michael D. Jamrosy, Thomas Mührke, Joseph J. Nemeth Jr., Richard T. Rowley

 

 

 

 





--
Juanje




--
Juanje



Archive powered by MHonArc 2.6.16.

§