File: rabbitmq_nodename.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 (8 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
Facter.add(:rabbitmq_nodename) do
  setcode do
    if Facter::Util::Resolution.which('rabbitmqctl')
      rabbitmq_nodename = Facter::Core::Execution.execute('rabbitmqctl status 2>&1')
      %r{^Status of node '?([\w\.\-]+@[\w\.\-]+)'?}.match(rabbitmq_nodename)[1]
    end
  end
end