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


Chronological Thread 
  • From: Jason Perry < >
  • To: " " < >
  • Cc: " " < >
  • Subject: [chef] Re: Re: Re: RE: Chef repo environment variable?
  • Date: Thu, 26 Jul 2012 18:39:39 -0400

Check out knife-block, that is what I use and like it a lot.

  -- Jay

On Jul 26, 2012, at 6:35 PM, Josiah Kiehl < "> > wrote:

I wrote this shell script and threw it on my PATH to swap knife configs between servers:


I create directories in this format: ~/.chef-SERVERNAME

I run knife-config SERVERNAME to swap to the server I want and it creates the correct symlink.

Josiah

On Thu, Jul 26, 2012 at 2:43 PM, Michael Johnston < " target="_blank"> > wrote:
.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: " target="_blank"> ] 
Sent: 26 July 2012 13:17
To:  " target="_blank">
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.

§