[chef] Re: RE: Chef repo environment variable?


Chronological Thread 
  • From: Michael Johnston < >
  • To:
  • Subject: [chef] Re: RE: Chef repo environment variable?
  • Date: Thu, 26 Jul 2012 14:43:53 -0700

.chef works like a standard unix dotfile, so my preference is to have a knife directory in each project, and symlink .chef => knife in each project.

When you use knife it will look first in your current working directory for a .chef folder, and then the parent directory recursively until it finds one.



On 2012-07-26, at 5:32 AM, Sullivan, Jon Paul wrote:

Simplest thing would likely be to add the following to your knife.rb:
 
cookbook_path ENV[‘CHEF_REPO’]
 
Thhis would set your cookbook path to the value of the CHEF_REPO variable in your environment.
 
You could also set a default in case you don’t have it set:
 
cb_path = ENV[‘CHEF_REPO’] || ~/cookbooks
cookbook_path cb_path
 
From: Cassiano Leal [mailto:  
Sent: 26 July 2012 13:17
To:  ">
Subject: [chef] Chef repo environment variable?
 
Hello,
 
I have been wondering, but couldn't find anything on the interwebs… Is there a way to point knife to the correct chef-repo path via an environment variable, say CHEF_HOME, or CHEF_REPO?
 
The reason I ask is that I have several contexts in my workstation (work, private project 1, private project 2, …). I use shell aliases to set several environment variables for each context (AWS keys and paths, other stuff), and when I open a new shell I just call the alias to set the context. 
 
Any pointers?
 
Thanks!
-- 
Cassiano Leal
 
Thanks, 
Jon-Paul Sullivan J Cloud Services - @hpcloud
                                       
Postal Address: Hewlett-Packard Galway Limited, Ballybrit Business Park, Galway.
Registered Office: Hewlett-Packard Galway Limited, 63-74 Sir John Rogerson's Quay, Dublin 2.
Registered Number: 361933
 
The contents of this message and any attachments to it are confidential and may be legally privileged. If you have received this message in error you should delete it from your system immediately and advise the sender.
 
To any recipient of this message within HP, unless otherwise stated, you should consider this message and attachments as "HP CONFIDENTIAL".





Archive powered by MHonArc 2.6.16.

§