2 # Copyright 2013,2014 whitestar
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 $LOAD_PATH.push("#{File.dirname(__FILE__)}/_lib")
18 #${chef-repo}/roles/_lib/grid.rb
24 description 'Grid Base ganglia gmetad node'
28 'role[nameservice-client-grid]',
29 'role[ganglia-gmond]',
30 'role[ganglia-gmetad]',
34 this_subcluster = Grid::CLUSTERS[:base][:gmetads]
35 mcast_addr = this_subcluster[:mcast_addr]
40 udp_send_channels4ucast = []
41 this_subcluster[:nodes].first(2).each {|host|
42 udp_send_channels4ucast.push(
45 'host' => "#{host}.#{Grid::DOMAIN}",
54 Grid::CLUSTERS[:base].each {|key, cluster|
57 :name => cluster[:alias],
58 :polling_interval => polling_interval,
60 :address_list => cluster[:nodes].first(2).map{|host| "#{host}.#{Grid::DOMAIN}"}
65 #env_run_lists "prod" => ["recipe[apache2]"], "staging" => ["recipe[apache2::staging]"], "_default" => []
71 "from .#{Grid::DOMAIN}",
72 'from 192.168.0.0/16'],
73 'AuthType' => 'Kerberos',
75 'KrbAuthRealms' => Grid::REALM,
76 'Krb5Keytab' => '/etc/krb5.keytab'
86 'name' => this_subcluster[:alias],
87 'owner' => Grid::DOMAIN
91 'udp_send_channels' => [
93 'mcast_join' => mcast_addr,
99 'udp_recv_channels' => [
101 'mcast_join' => mcast_addr,
108 'udp_send_channels' => udp_send_channels4ucast,
109 'udp_recv_channels' => [
119 'gridname' => 'Grid-Base',
120 'trusted_hosts' => ['127.0.0.1'] \
121 + Grid::CLUSTERS[:base][:nagioses][:nodes].map{|host| "#{host}.#{Grid::DOMAIN}"},
122 'data_sources' => data_sources