diff --git a/src/cookbooks/resource_logs_processor/attributes/default.rb b/src/cookbooks/resource_logs_processor/attributes/default.rb index 4351106..e54f5e5 100644 --- a/src/cookbooks/resource_logs_processor/attributes/default.rb +++ b/src/cookbooks/resource_logs_processor/attributes/default.rb @@ -28,7 +28,7 @@ # LOGSTASH # -home_directory = '/usr/local/logstash' +home_directory = '/usr/share/logstash' settings_directory = '/etc/logstash' default['logstash']['path']['home'] = home_directory default['logstash']['path']['bin'] = "#{home_directory}/bin" diff --git a/src/cookbooks/resource_logs_processor/spec/logstash_spec.rb b/src/cookbooks/resource_logs_processor/spec/logstash_spec.rb index b8ec2bd..caee6fb 100644 --- a/src/cookbooks/resource_logs_processor/spec/logstash_spec.rb +++ b/src/cookbooks/resource_logs_processor/spec/logstash_spec.rb @@ -6,16 +6,16 @@ context 'creates the logstash directories' do let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) } - it 'creates the logstash install directory at /usr/local/logstash' do - expect(chef_run).to create_directory('/usr/local/logstash').with( + it 'creates the logstash install directory at /usr/share/logstash' do + expect(chef_run).to create_directory('/usr/share/logstash').with( group: 'logstash', mode: '0550', owner: 'logstash' ) end - it 'creates the logstash install directory at /usr/local/logstash/bin' do - expect(chef_run).to create_directory('/usr/local/logstash/bin').with( + it 'creates the logstash install directory at /usr/share/logstash/bin' do + expect(chef_run).to create_directory('/usr/share/logstash/bin').with( group: 'logstash', mode: '0550', owner: 'logstash' @@ -38,8 +38,8 @@ ) end - it 'creates the logstash plugins directory at /usr/local/logstash/plugins' do - expect(chef_run).to create_directory('/usr/local/logstash/plugins').with( + it 'creates the logstash plugins directory at /usr/share/logstash/plugins' do + expect(chef_run).to create_directory('/usr/share/logstash/plugins').with( group: 'logstash', mode: '0550', owner: 'logstash' @@ -168,7 +168,7 @@ # Entropy source for randomness -Djava.security.egd=file:/dev/urandom CONF - it 'creates jvm.options in the configuratino directory' do + it 'creates jvm.options in the configuration directory' do expect(chef_run).to create_file('/etc/logstash/jvm.options') .with_content(jvm_options_content) .with( diff --git a/tests/integration/pester/Logstash.Tests.ps1 b/tests/integration/pester/Logstash.Tests.ps1 index 5f8e51f..ba1fb0b 100644 --- a/tests/integration/pester/Logstash.Tests.ps1 +++ b/tests/integration/pester/Logstash.Tests.ps1 @@ -1,8 +1,8 @@ Describe 'The logstash application' { Context 'is installed' { - It 'with binaries in /usr/local/logstash' { - '/usr/local/logstash' | Should Exist - '/usr/local/logstash/bin' | Should Exist + It 'with binaries in /usr/share/logstash' { + '/usr/share/logstash' | Should Exist + '/usr/share/logstash/bin' | Should Exist } It 'with configurations in /etc/logstash' { @@ -23,8 +23,8 @@ Describe 'The logstash application' { $expectedContent = @' [Service] Type = forking -PIDFile = /usr/local/logstash/logstash_pid -ExecStart = /usr/local/logstash/run_logstash.sh +PIDFile = /tmp/logstash_pid +ExecStart = /usr/share/logstash/run_logstash.sh RestartSec = 5 Restart = always User = logstash