Skip to content

Commit

Permalink
delete unused config if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreyc-splunk committed Nov 10, 2023
1 parent c3ecf83 commit 1e71b7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/chef-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- main
- chef-new-zeroconfig-test
paths:
- '.github/workflows/chef-test.yml'
- 'deployments/chef/**'
Expand Down
7 changes: 7 additions & 0 deletions deployments/chef/recipes/auto_instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
end

if node['splunk_otel_collector']['auto_instrumentation_systemd'].to_s.downcase == 'true'
execute 'remove libsplunk.so from /etc/ld.so.preload' do
command 'sed -i "s|/usr/lib/splunk-instrumentation/libsplunk.so||" /etc/ld.so.preload'
only_if 'test -f /etc/ld.so.preload && grep /usr/lib/splunk-instrumentation/libsplunk.so /etc/ld.so.preload'
end
execute 'reload systemd' do
command 'systemctl daemon-reload'
action :nothing
Expand All @@ -35,6 +39,9 @@
notifies :run, 'execute[reload systemd]', :immediately
end
else
file '/usr/lib/systemd/system.conf.d/00-splunk-otel-auto-instrumentation.conf' do
action :delete
end
template '/etc/ld.so.preload' do
source 'ld.so.preload.erb'
end
Expand Down

0 comments on commit 1e71b7e

Please sign in to comment.