Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (29 sloc) 0.862 kB
2a52648 @grantr add readme, todo, and some config comments
authored
1 # configure block has to be first
2 # servers is an array of zk servers; required
2b25b46 @grantr initial commit
authored
3 configure do |config|
4 config.servers = ["127.0.0.1:2181"]
5 #config.prefix = "/gamewarden"
6 end
7
2a52648 @grantr add readme, todo, and some config comments
authored
8 # register creates a node if it doesn't exist
9 # must be before any watch blocks referencing this node
10 # params are path, data
2b25b46 @grantr initial commit
authored
11 register "/memcached", "memcached servers"
12
2a52648 @grantr add readme, todo, and some config comments
authored
13 # watch a node for events
2b25b46 @grantr initial commit
authored
14 watch "/memcached" do
2a52648 @grantr add readme, todo, and some config comments
authored
15
2b25b46 @grantr initial commit
authored
16 on :children_changed do |event|
17 puts "children changed to #{event.nodes.inspect}"
18 # update dna with new child list
19 # run chef
20 end
21
2a52648 @grantr add readme, todo, and some config comments
authored
22 on [:node_deleted, :node_created] do |event|
23 puts "node state changed"
24 end
25 end
2b25b46 @grantr initial commit
authored
26
2a52648 @grantr add readme, todo, and some config comments
authored
27 # create an ephemeral node
28 # sequence optional
29 # data is result of block
2b25b46 @grantr initial commit
authored
30 maintain "/memcached/server", :sequence => true do
31 "127.0.0.1:1024"
32 end
33
2a52648 @grantr add readme, todo, and some config comments
authored
34 # can also pass data as an argument
35 #maintain "/memcached/127.0.0.1:1024", "data"
Something went wrong with that request. Please try again.