You can use the knife block plugin to manage different knife.rb files that point to different Chef servers.
Chris
From: Yoshi Spendiff [mailto: " target="_blank"> ]
Sent: Tuesday, July 07, 2015 5:27 PM
To: chef
Subject: [chef] Re: Re: It is possible use One workstation for multiple servers
There's also the knife block plug-in
On Tue, Jul 7, 2015 at 1:18 PM, Daniel DeLeo < " target="_blank"> > wrote:
On Tuesday, July 7, 2015 at 12:58 PM, Joseph Djomeda wrote:
> Hello Guys,
>
> Sorry for the beginner questions I keep asking recently. :D I am a beginner anyways ;)
>
> We have opted for hosted chef , and in another thread here, I passed a comment on using using ansible local/test/experiments stuff and I was advised to stick to one. In an attempt of doing that I realized I am more comfortable with a local community chef server installed on premise in our office.
There are several ways to do this.
1. knife will look in your current working directory and up for a .chef directory with your config file. So you just have one top level directory for each Chef server you want to talk to. Note that this uses the PWD environment variable (if set, otherwise it falls back to what the OS provides), so you can symlink in projects (like a chef repo or individual cookbooks) to avoid having multiple copies and it will do the right thing.
2. Chef config files are just ruby code, so you can define multiple configurations in one knife config, and set an environment variable to choose which one you want. If you do this, you might want to add the variable to your terminal prompt so you know which server you’re talking to.
3. Use a tool like https://github.com/trobrock/chefvm
4. Specify the config file with the -c option all the time.
There could be still others, but these are the ones I can remember off the top of my head. I personally use option 1.
> Thanks in advance and Best Regards,
> --
> Joseph Kodjo-Kuma Djomeda
--
Daniel DeLeo
--
Archive powered by MHonArc 2.6.16.