OSDN Git Service

refactor roles.
[metasearch/grid-chef-repo.git] / roles / pleiades-wf.rb
1 $LOAD_PATH.push("#{File.dirname(__FILE__)}/../_lib")
2 #${chef-repo}/_lib/grid.rb
3 require 'grid'
4
5 name 'pleiades-wf'
6 description 'Pleiades workflow node'
7
8 run_list(
9   'role[node_commons]',
10   'role[grid-realm]',
11   'role[ganglia-gmond]'
12 )
13
14 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
15
16 this_subcluster = Grid::CLUSTERS[:pleiades][:workflows]
17 mcast_addr = this_subcluster[:mcast_addr]
18 port = '8649'
19 =begin
20 # uni-cast
21 udp_send_channels4ucast = []
22 this_subcluster[:nodes].first(2).each {|host|
23   udp_send_channels4ucast.push(
24     {
25       'mcast_join' => '',
26       'host' => "#{host}.#{Grid::DOMAIN}",
27       'port' => port,
28       'ttl' => ''
29     }
30   )
31 }
32 =end
33
34 default_attributes(
35 )
36
37 override_attributes(
38   'ganglia' => {
39     # gmond
40     'cluster' => {
41       'name' => this_subcluster[:alias],
42       'owner' => Grid::DOMAIN
43     },
44     'static' => {
45       ## static multi-cast
46       'udp_send_channels' => [
47         {
48           'mcast_join' => mcast_addr,
49           'host' => '',
50           'port' => port,
51           'ttl' => '1'
52         }
53       ],
54       'udp_recv_channels' => [
55         {
56           'mcast_join' => mcast_addr,
57           'port' => port,
58           'bind' => mcast_addr
59         }
60       ]
61 =begin
62       ## static uni-cast
63       'udp_send_channels' => udp_send_channels4ucast,
64       'udp_recv_channels' => [
65         {
66           'mcast_join' => '',
67           'port' => port,
68           'bind' => ''
69         }
70       ]
71 =end
72     }
73   }
74 )