[chef] RE: Chef repo environment variable?


Chronological Thread 
  • From: "Sullivan, Jon Paul" < >
  • To: " " < >
  • Subject: [chef] RE: Chef repo environment variable?
  • Date: Thu, 26 Jul 2012 12:32:37 +0000
  • Accept-language: en-IE, en-US

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.

§