Skip to content

Commit

Permalink
correct elasticsearch bin location
Browse files Browse the repository at this point in the history
  • Loading branch information
dearing committed Jul 27, 2015
1 parent ccf120d commit 9ad564c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
5 changes: 4 additions & 1 deletion libraries/provider_elasticsearch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class Elasticsearch < Chef::Provider::LWRPBase
service_name = 'elasticsearch'

action :install do

home_dir = "#{new_resource.path}/elasticsearch-#{new_resource.version}"

user new_resource.user
group new_resource.group

Expand All @@ -30,7 +33,7 @@ class Elasticsearch < Chef::Provider::LWRPBase
cookbook new_resource.source
env new_resource.runit_env
options new_resource.runit_options.merge(
'install_path' => "#{new_resource.path}/#{new_resource.name}-#{new_resource.version}",
'home_dir' => home_dir,
'user' => new_resource.user,
'group' => new_resource.group
)
Expand Down
2 changes: 1 addition & 1 deletion libraries/provider_kibana.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Kibana < Chef::Provider::LWRPBase
cookbook new_resource.source
env new_resource.runit_env
options new_resource.runit_options.merge(
'install_path' => home_dir,
'home_dir' => home_dir,
'user' => new_resource.user,
'group' => new_resource.group,
'config_file' => "#{home_dir}/config/kibana.yml"
Expand Down
1 change: 1 addition & 0 deletions libraries/provider_logstash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class Logstash < Chef::Provider::LWRPBase
owner new_resource.user
group new_resource.group
mode '0755'
recursive true
action :create
end

Expand Down
2 changes: 1 addition & 1 deletion templates/default/sv-elasticsearch-run.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cd <%= @options['install_path'] %>
cd <%= @options['home_dir'] %>
exec 2>&1

chpst -u :<%= @options['user'] %>:<%= @options['group'] %>
Expand Down
2 changes: 1 addition & 1 deletion templates/default/sv-kibana-run.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cd <%= @options['install_path'] %>
cd <%= @options['home_dir'] %>
exec 2>&1

chpst -u :<%= @options['user'] %>:<%= @options['group'] %>
Expand Down
10 changes: 4 additions & 6 deletions test/integration/helpers/serverspec/elasticsearch.rb
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# sshd_service = os[:family] == 'redhat' ? 'sshd' : 'ssh'

shared_examples 'elasticsearch' do
describe service('elasticsearch') do
it 'is enabled and running' do
expect(subject).to be_enabled
expect(subject).to be_running
end
end
describe command('sv status elasticsearch') do
its(:stdout) { should match /run: elasticsearch/ }
end
end

# curl -X GET http://localhost:9200/
# curl 'localhost:9200/_cat/health?v'

0 comments on commit 9ad564c

Please sign in to comment.