File: erl_ssl_path.rb

package info (click to toggle)
puppet-module-puppetlabs-rabbitmq 8.5.0-10
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,192 kB
  • sloc: ruby: 5,227; sh: 10; makefile: 4
file content (13 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
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