[chef] Re: how to make one node tell another to do some work


Chronological Thread 
  • From: Denis Haskin < >
  • To:
  • Subject: [chef] Re: how to make one node tell another to do some work
  • Date: Fri, 28 Sep 2012 11:19:03 -0400

This doesn't feel like chef is the right tool for this.

What you're describing is a distributed work queue, no?  Why try to do this via chef?

There are lots of frameworks, tools, services out there that are designed for this use case.  Perhaps I'm missing something in what you're trying to do?

--
Denis Haskin


On Fri, Sep 28, 2012 at 10:39 AM, Jesse Campbell < " target="_blank"> > wrote:
I have an "admin" machine of sorts that runs some reports in a
database, then based on the result of that report, a set of nodes will
need to do some work (customer migrations, updates, etc)

I want the admin machine to tell the end node it has work to do, then
the end node update whatever that thing is to say it is done.

Options I've considered:
1) databag
admin machine adds entries to a databag that has sub-hashes for each
end node, end node updates databag to remove work items
will it work? yes
but all machines need to be admin clients to be able to edit the
databag. I don't want this.

2) node attributes
admin machine adds entries to a hash in each individual node's attributes.
will it work? I don't know... I tried this:
search(:node, "fqdn:#{machine_to_be_updated}) do |machine|
  machine.set["hash"].push "work_to_do"
end

and nothing ended up in that hash.

3) more node attributes
admin machines adds entries to a has in its own attributes, end nodes
look for entries in admin machine's attributes, do the work, then add
entries to their own attributes that says they did the work, admin
machine removes entries from its hash based on whether the end node's
attributes hash for completed work contains the work item, end node
removes entries from completed work hash based on what is no longer on
admin machine
will it work? yes, but it is messy!

Any other ideas I'm not thinking of? Any way to make #2 work? Should
#2 work as I specified it? Can one node modify another node's
attributes? Is there a different way to pick up the node besides
search? should i update that node's attributes using a databag method
(since node attributes are just a type of databag), or can you even do
that? is there a node.save() method that I'm not calling?

Thanks!
-Jesse




Archive powered by MHonArc 2.6.16.

§