OSDN Git Service

fix service control.
[metasearch/grid-chef-repo.git] / roles / pleiades-gw.rb
1 #
2 # Copyright 2013-2014, whitestar
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 $LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
18 #${chef-repo}/roles/_lib/grid.rb
19 require 'grid'
20
21 name 'pleiades-gw'
22 description 'Pleiades gateway node'
23
24 run_list(
25   'role[node_commons]',
26   'role[grid-realm]',
27   'role[ganglia-gmond]',
28   'role[pleiades-node]',
29   'role[pig]'
30 )
31
32 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
33
34 this_subcluster = Grid::CLUSTERS[:pleiades][:gateways]
35 mcast_addr = this_subcluster[:mcast_addr]
36 port = '8649'
37 =begin
38 # uni-cast
39 udp_send_channels4ucast = []
40 this_subcluster[:nodes].first(2).each {|host|
41   udp_send_channels4ucast.push(
42     {
43       'mcast_join' => '',
44       'host' => "#{host}.#{Grid::DOMAIN}",
45       'port' => port,
46       'ttl' => ''
47     }
48   )
49 }
50 =end
51
52 default_attributes(
53 )
54
55 override_attributes(
56   'ganglia' => {
57     # gmond
58     'cluster' => {
59       'name' => this_subcluster[:alias],
60       'owner' => Grid::DOMAIN
61     },
62     ## static multi-cast
63     'static' => {
64       'udp_send_channels' => [
65         {
66           'mcast_join' => mcast_addr,
67           'host' => '',
68           'port' => port,
69           'ttl' => '1'
70         }
71       ],
72       'udp_recv_channels' => [
73         {
74           'mcast_join' => mcast_addr,
75           'port' => port,
76           'bind' => mcast_addr
77         }
78       ]
79 =begin
80       ## static uni-cast
81       'udp_send_channels' => udp_send_channels4ucast,
82       'udp_recv_channels' => [
83         {
84           'mcast_join' => '',
85           'port' => port,
86           'bind' => ''
87         }
88       ]
89 =end
90     }
91   },
92   'pig' => {
93     'version' => '0.11.1'
94   }
95 )