Skip to content

Commit

Permalink
rabbitmq: Use systemd-detect-virt instead of custom code
Browse files Browse the repository at this point in the history
This was suggested by Dirk Mueller, and is indeed a much safer way to
detect virtualized environment.
  • Loading branch information
vuntz committed Jan 21, 2018
1 parent 8133919 commit 68bd590
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions chef/cookbooks/rabbitmq/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,9 @@
notifies :restart, "service[rabbitmq-server]"
end

virtualized = [
"KVM", "QEMU", "Bochs",
"VMWare Virtual Platform", "VMware Virtual Platform",
"VirtualBox"
]
hipe_compile = node[:rabbitmq][:hipe_compile] &&
node[:dmi][:system] &&
!virtualized.include?(node[:dmi][:system][:product_name]) &&
!virtualized.include?(node[:dmi][:system][:manufacturer])
`systemd-detect-virt -v -q`
virtualized = $?.exitstatus.zero?
hipe_compile = node[:rabbitmq][:hipe_compile] && !virtualized

template "/etc/rabbitmq/rabbitmq.config" do
source "rabbitmq.config.erb"
Expand Down

0 comments on commit 68bd590

Please sign in to comment.