[chef] Re: Re: Re: Running chef-client from another server and waiting for a result

Chronological Thread 
  • From: Charles Duffy < >
  • To:
  • Subject: [chef] Re: Re: Re: Running chef-client from another server and waiting for a result
  • Date: Mon, 4 Jul 2011 22:40:35 -0500

That depends on how paranoid you are about starting from a clean slate. :)

In a past life, I did something like this with virtual machines, spinning up a brand new guest with copy-on-write disk images for each instance. These days, plenty of cloud providers give you a means to build a system from a template set to run a prebuilt task on boot, and I might well end up doing that. For physical hardware, you could use Cobbler to automate the process of PXE-booting, installing a new OS, and then running the scripts of your choice on that completely clean machine. If I can make this fit inside my runtime constraints (PXE-booting an OS on modern physical hardware is typically about 10 minutes, to give you a benchmark; copy-on-write image spawning is basically instant; cloning a new cloud system from a prebuilt image varies pretty wildly with your cloud provider), it's what I'll probably do again this time.

Now, if you were using physical hardware (where you couldn't do the roll-back-to-snapshot thing) and didn't want the delay of an OS reinstall or the work of setting up a local copy-on-write filesystem... well, plenty of ways to kick of chef-client.

That *could* be as easy as having your CI server have a SSH key in the authorized_keys file on your test system, and a SSH command that kicks off chef-client.

or... you could have your CI server commit to a git branch whenever your prior code passes smoke testing, and have the test server poll that branch
or... you could have your CI tool do a git push to a branch local to the test server, and a commit hook that takes actions resulting in chef-client being spawned
or ...have your git server spawn an action when that commit happens (github has all kinds of hooks, down to AMQP or XMPP event publishing)

...etc. Sky's the limit, use-your-imagination, etc.

On Mon, Jul 4, 2011 at 8:12 PM, Edward Sargisson < "> > wrote:
Hi Charles,
Thanks for the reply..

> What part of the process do you have questions about?
From serverA I want to tell serverB to run chef-client and tell
serverA when it's done.

The notification bit can probably be done in the report handler
(somehow) but how do I tell serverB to start chef-client?


On Mon, Jul 4, 2011 at 5:48 PM, Charles Duffy < "> > wrote:
> Yes, this certainly can be done -- in fact, I'll be doing the same thing in
> just a few weeks.
> What part of the process do you have questions about?
> On Jul 4, 2011 7:34 PM, "Edward Sargisson" < "> > wrote:
>> Hi all,
>> I am thinking of incorporating Chef into a continuous integration
>> server (in this case Bamboo but think Hudson/Jenkins).
>> I'd like to do a build, configure Chef properties for the new version,
>> then kick off chef-client on the test server. Once it's done, I want
>> the script to know about it so that integration tests can be run
>> against it.
>> Is there a way to do this or am I using Chef beyond its purpose?
>> Thanks in advance,
>> Edward

Archive powered by MHonArc 2.6.16.