OSDN Git Service

add apt_utils cookbook.
[metasearch/grid-chef-repo.git] / roles / test-on-localhost.rb
1 name 'test-on-localhost'
2 description 'Testing on local machine'
3
4 run_list(
5   'role[mocker]',
6   'role[node_commons]',
7   'role[chef_utils]',
8   'role[nameservice-client]',
9   'role[ganglia-gmond-ucast-localhost]',
10   'role[ganglia-gmetad-localhost]',
11   'role[ganglia-web]',
12   'role[nagios]',
13   'role[hadoop-pseudo-distributed-with-security]',
14   'role[zookeeper-pseudo-replicated-with-security]',
15   'role[hbase-pseudo-distributed-with-security]',
16   'role[pig]',
17   'role[grid-ops-utils]'
18 )
19
20 #env_run_lists()
21
22 default_attributes(
23   'grid' => {
24     'gridctl' => {
25       'env' => {
26         #'DOMAIN' => '',
27         #'HADOOP_ARTIFACT_TYPE' => 'tarball',
28         'HADOOP_DISTRIBUTION' => 'apache',
29         #'HADOOP_HOME' => '/grid/usr/hadoop',
30       }
31     }
32   },
33   'openldap' => {
34     'client' => {
35       'URI' => 'ldap://localhost/',
36       'BASE' => 'dc=localdomain',
37       'TLS_CACERT' => '/etc/ssl/certs/cacert.pem',
38       'TLS_REQCERT' => 'allow',
39       'TLS_CHECKPEER' => 'yes',
40       'SASL_MECH' => 'GSSAPI'
41     },
42     'nss-ldapd' => {
43       'uri' => 'ldap://localhost/',
44       'base' => 'dc=localdomain',
45       'ssl' => 'start_tls',
46       'tls_cacertfile' => '/etc/ssl/certs/cacert.pem',
47       'tls_reqcert' => 'demand'
48     },
49     #'ldap_lookup_nameservices' => ['passwd', 'group']
50   },
51   'krb5' => {
52     'libdefaults' => {
53       'default_realm' => 'LOCALDOMAIN',
54       # strong crypto
55       'default_tgs_enctypes' \
56         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5',
57       'default_tkt_enctypes' \
58         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5',
59       'permitted_enctypes' \
60         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5'
61       # or weak crypto for 1.0.x KSSL
62       #'allow_weak_crypto' => 'true',
63       #'default_tgs_enctypes' \
64       #  => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5 des-cbc-crc des-cbc-md5',
65       #'default_tkt_enctypes' \
66       #  => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5 des-cbc-crc des-cbc-md5',
67       #'permitted_enctypes' \
68       #  => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5 des-cbc-crc des-cbc-md5'
69     }
70   },
71   'ganglia' => {
72     'trusted_hosts' => ['127.0.0.1'],
73     'web' => {
74       #'Allow' => ['from .grid.example.com'],
75       'AuthType' => 'Kerberos',
76       'mod_auth_kerb' => {
77         'KrbAuthRealms' => 'LOCALDOMAIN',
78         'Krb5Keytab' => '/etc/krb5.keytab'
79       }
80     }
81   },
82   'nagios' => {
83     'web' => {
84       #'Allow' => ['from .grid.example.com'],
85       'AuthType' => 'Kerberos',
86       'mod_auth_kerb' => {
87         'KrbAuthRealms' => 'LOCALDOMAIN',
88         'Krb5Keytab' => '/etc/krb5.keytab'
89       }
90     },
91     'check_external_commands' => '1',
92     'use_regexp_matching' => '1',
93     'authorized_for_system_information' => '*',
94     'authorized_for_configuration_information' => '*',
95     'authorized_for_system_commands' => '*',
96     'authorized_for_all_services' => '*',
97     'authorized_for_all_hosts' => '*',
98     'authorized_for_all_service_commands' => '*',
99     'authorized_for_all_host_commands' => '*',
100     'check_ganglia_metric' => {
101       'enabled' => true,
102       'gmetad_host' => 'localhost'
103     },
104     'objects' => {
105       'hosts' => [
106         {
107           'use' => 'generic-host',
108           'host_name' => 'localhost4gmon',
109           'address' => 'localhost'  # not 127.0.0.1
110         }
111       ],
112       'services' => [
113         # ganglia gmetad monitoring
114         {
115           'use' => 'generic-check_ganglia_cache-service',
116           'contact_groups' => 'admins',
117           'host_name' => 'localhost'
118         },
119         {
120           'use' => 'generic-ganglia_heartbeat-service',
121           'contact_groups' => 'admins',
122           'host_name' => 'localhost4gmon'
123           #'hostgroup_name' => 'gmetads',
124         },
125         # standard monitoring.
126         {
127           'use' => 'generic-ping-service',
128           'contact_groups' => 'admins',
129           #'contact_groups' => 'grid-admins',
130           'host_name' => 'localhost',
131           #'hostgroup_name' => 'grid-servers',
132         },
133         # monitoring via Ganglia
134         {
135           'use' => 'generic-load_one-service',
136           'contact_groups' => 'admins',
137           'host_name' => 'localhost4gmon'
138         },
139       ],
140       'servicedependencies' => [
141         {
142           'host_name' => 'localhost',
143           'service_description' => 'Cache for check_ganglia_metric',
144           'dependent_host_name' => 'localhost4gmon',
145           #'dependent_host_name' => '.*',
146           #'dependent_hostgroup_name' => 'grid-servers',
147           'dependent_service_description' => '.* via Ganglia$',
148           'execution_failure_criteria' => 'c,p'
149         }
150       ]
151     }
152   },
153   'zookeeper' => {
154     'version' => '3.4.5'
155   },
156   'hadoop' => {
157     #'version' => '2.1.0-beta',
158     #'version' => '2.0.6-alpha',
159     'version' => '1.2.1',
160     #'version' => '1.1.2',
161     #'version' => '1.0.4',
162     'hadoop.http.authentication.type' => 'simple',
163     'metrics2' => {
164       'namenode.sink.ganglia.servers' => 'localhost:8649',
165       'datanode.sink.ganglia.servers' => 'localhost:8649',
166       # for 2.0.x only
167       'resourcemanager.sink.ganglia.servers' => 'localhost:8649',
168       'nodemanager.sink.ganglia.servers' => 'localhost:8649',
169       # for 1.0.x only
170       'jobtracker.sink.ganglia.servers' => 'localhost:8649',
171       'tasktracker.sink.ganglia.servers' => 'localhost:8649',
172       'maptask.sink.ganglia.servers' => 'localhost:8649',
173       'reducetask.sink.ganglia.servers' => 'localhost:8649'
174     },
175     # for 2.0.x only >>
176     #'yarn.nodemanager.admin-env' => 'MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX',
177     'yarn.nodemanager.admin-env' => 'MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX,LD_LIBRARY_PATH=${HADOOP_COMMON_HOME}/lib/native',
178     'yarn.nodemanager.linux-container-executor.resources-handler.class' \
179       => 'org.apache.hadoop.yarn.server.nodemanager.util.CgroupsLCEResourcesHandler',
180     # for 1.0.x only >>
181     'extra_configs' => {
182       'core-site.xml' => {
183         'hadoop.http.authentication.signature.secret' \
184           => '91d365813d6dd1f4ceafff73f90a9a06'
185       }
186     },
187     'krb5_strong_crypto' => {
188       'default_tgs_enctypes' \
189         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5',
190       'default_tkt_enctypes' \
191         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5',
192       'permitted_enctypes' \
193         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5'
194     },
195     'krb5_weak_crypto' => {
196       'default_tgs_enctypes' \
197         => 'des-cbc-crc des-cbc-md5',
198       'default_tkt_enctypes' \
199         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5 des-cbc-crc des-cbc-md5',
200       'permitted_enctypes' \
201         => 'aes256-cts-hmac-sha1-96 aes128-cts-hmac-sha1-96 arcfour-hmac-md5 des-cbc-crc des-cbc-md5'
202     }
203     # <<
204   },
205   'hbase' => {
206     'version' => '0.94.7'
207   },
208   'pig' => {
209     'version' => '0.11.1'
210     #'version' => '0.11.0'
211   }
212 )
213
214 override_attributes(
215   'ganglia' => {
216     'trusted_hosts' => ['127.0.0.1'],
217 =begin
218     # for TEST
219     'gmond_conf_type' => 'automatic',
220     'automatic' => {
221       #'cast_mode' => 'multi'
222       'cast_mode' => 'uni'
223     }
224 =end
225   }
226 )
227