Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Fix installation from source on Ubuntu 16.04 #493

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ This will create system init scripts for managing logstash instance. It will t

see [resources/service.rb](resources/service.rb)

_experimental support for pleaserun has been added. Only `native` for `Ubuntu 12.04` has been thoroughly tested._
_experimental support for pleaserun has been added. Only `native` for `Ubuntu 16.04` has been thoroughly tested._

## logstash_config

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
depends 'curl'
depends 'beaver'

chef_version '>= 13.0' if respond_to?(:chef_version)
chef_version '>= 12.18' if respond_to?(:chef_version)
issues_url 'https://github.com/lusis/chef-logstash/issues'
source_url 'https://github.com/lusis/chef-logstash'
3 changes: 2 additions & 1 deletion providers/instance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def load_current_resource
mode '0755'
owner ls[:user]
group ls[:group]
recursive true
end
new_resource.updated_by_last_action(idr.updated_by_last_action?)

Expand Down Expand Up @@ -218,7 +219,7 @@ def load_current_resource
er = execute 'build-logstash' do
cwd "#{ls[:instance_dir]}/source"
environment(JAVA_HOME: @java_home)
user ls_user # Changed from root cause building as root...WHA?
user ls[:user] # Changed from root cause building as root...WHA?
command "make clean && make VERSION=#{source_version} jar"
action :run
creates "#{ls[:instance_dir]}/source/build/logstash-#{source_version}--monolithic.jar"
Expand Down
2 changes: 1 addition & 1 deletion providers/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def load_current_resource

def default_args
svc = svc_vars
args = ['agent', '-f', "#{svc[:home]}/etc/conf.d/"]
args = ['-f', "#{svc[:home]}/etc/conf.d/"]
args.concat ['-vv'] if svc[:debug]
args.concat ['-l', svc[:log_file]] if svc[:log_file]
args.concat ['-w', svc[:workers].to_s] if svc[:workers]
Expand Down
2 changes: 1 addition & 1 deletion test/unit/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

::UBUNTU_OPTS = {
platform: 'ubuntu',
version: '12.04',
version: '16.04',
log_level: ::LOG_LEVEL
}

Expand Down
6 changes: 3 additions & 3 deletions test/unit/spec/util_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

describe '::determine_platform_major_version' do
context 'with ubuntu' do
let(:node) { { 'platform' => 'ubuntu', 'platform_version' => '12.04' } }
let(:node) { { 'platform' => 'ubuntu', 'platform_version' => '16.04' } }
it 'returns full version' do
expect(Logstash.determine_platform_major_version(node)).to eql(12.04)
expect(Logstash.determine_platform_major_version(node)).to eql(16.04)
end
end

Expand Down Expand Up @@ -33,7 +33,7 @@
end
end
context 'after user' do
let(:node) { { 'platform' => 'ubuntu', 'platform_version' => '12.04' } }
let(:node) { { 'platform' => 'ubuntu', 'platform_version' => '16.04' } }
it 'returns true' do
expect(Logstash.upstart_supports_user?(node)).to eql(true)
end
Expand Down