/
default.rb
68 lines (56 loc) · 1.53 KB
/
default.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# this is a test fixture used to test that the elasticsearch cookbook's
# resources, providers, and recipes can be used correctly from a wrapper
# create user with all non-default overriden options
elasticsearch_user 'foobar' do
groupname 'bar'
username 'foo'
uid 1111
gid 2222
shell '/bin/sh'
homedir '/usr/local/myhomedir'
end
elasticsearch_user 'deleteme'
elasticsearch_user 'deleteme' do
action :remove
end
# we're going to test both types on a single system!
elasticsearch_install 'elasticsearch_p' do
type :package
end
elasticsearch_install 'elasticsearch_s' do
type :source
dir '/usr/local/awesome'
owner 'foo'
group 'bar'
end
elasticsearch_configure 'my_elasticsearch' do
dir '/usr/local/awesome'
user 'foo'
group 'bar'
logging({:"action" => 'INFO'})
allocated_memory '123m'
thread_stack_size '512k'
env_options '-DFOO=BAR'
gc_settings <<-CONFIG
-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:CMSInitiatingOccupancyFraction=75
-XX:+UseCMSInitiatingOccupancyOnly
-XX:+HeapDumpOnOutOfMemoryError
-XX:+PrintGCDetails
CONFIG
configuration ({
'node.name' => 'crazy'
})
action :manage
end
elasticsearch_plugin 'mobz/elasticsearch-head' do
plugin_dir '/usr/local/awesome/elasticsearch-1.5.0/plugins'
end
elasticsearch_service 'elasticsearch-crazy' do
node_name 'crazy'
path_conf '/usr/local/awesome/etc/elasticsearch'
pid_path '/usr/local/awesome/var/run'
user 'foo'
group 'bar'
end