X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Frabbitmq%2Flib%2Ffacter%2Ferl_ssl_path.rb;fp=3rdparty%2Fmodules%2Frabbitmq%2Flib%2Ffacter%2Ferl_ssl_path.rb;h=c8f41f69b18d2eb745c10a174f09f04a26da33e2;hb=921e69100a563cf143f56a3905d8362336d939ff;hp=0000000000000000000000000000000000000000;hpb=b54f52d2899c5785923c804fdfbba0782c147da4;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/rabbitmq/lib/facter/erl_ssl_path.rb b/3rdparty/modules/rabbitmq/lib/facter/erl_ssl_path.rb new file mode 100644 index 000000000..c8f41f69b --- /dev/null +++ b/3rdparty/modules/rabbitmq/lib/facter/erl_ssl_path.rb @@ -0,0 +1,13 @@ +# Fact to get the ssl path for the erlang distribution in the current +# system as described in the RabbitMQ docs [1]. +# +# [1] https://www.rabbitmq.com/clustering-ssl.html +Facter.add(:erl_ssl_path) do + setcode do + if Facter::Util::Resolution.which('erl') + data = Facter::Core::Execution.execute("erl -eval 'io:format(\"~p\", [code:lib_dir(ssl, ebin)]),halt().' -noshell") + # erl returns the string with quotes, strip them off + data.gsub!(%r{\A"|"\Z}, '') + end + end +end