- From: Adam Jacob <adam@opscode.com>
- To: chef@lists.opscode.com
- Subject: Re: chef + vlad/capistrano?
- Date: Tue, 10 Mar 2009 10:22:25 -0700
On Tue, Mar 10, 2009 at 2:10 AM, Michal Frackowiak <michalf@wikidot.com>
wrote:
>
2. Fetching list of active nodes and removing nodes
>
>
Thanks to Adam for the hint how to pull node information from the indexer
>
through the REST API. What we are going to do is we are adding the
>
"capistrano_role" attribute to the nodes automatically when we initialize
>
the node.
>
>
The problem with the nature of EC2 is that instances can be short-lived and
>
they are not automatically removed from the list of nodes and this could
>
confuse our capistrano tasks.
>
>
Is there a REST API we could hook to? (Could not find any documentation for
>
it yet, but I would be happy to get a hint where to look for). Removing
>
nodes is a key for our application since we have variable number of e.g.
>
video transcoding nodes.
Yes. You can do:
node_list = rest.get_rest('nodes')
node_list.each do |node_name|
rest.delete_rest('nodes/#{node_name}')
end
Make sure that the registration you are using for the API has 'admin'
privileges (you can find out by clicking 'Registrations' in the Web
UI, and clicking 'Admin' next to the one you are using.)
Adam
--
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-4759 E: adam@opscode.com
Archive powered by MHonArc 2.6.16.