Commit b9456f74 authored by Jonathan's avatar Jonathan
Browse files

Merge pull request #27 from djjudas21/conditional_facts

Make facts fail gracefully if radiusd is not installed
parents 0dc3a9a4 d8a696e4
# Grab the FreeRADIUS version from the output of radiusd -v
Facter.add(:freeradius_maj_version) do
setcode do
Facter::Core::Execution.exec('radiusd -v').split(/\n/)[0].match(/FreeRADIUS Version (\d)\.\d\.\d/)[1]
version = Facter::Core::Execution.exec('radiusd -v')
if !version.nil?
version = version.split(/\n/)[0].match(/FreeRADIUS Version (\d)\.\d\.\d/)[1].to_s
end
version
end
end
# Grab the FreeRADIUS version from the output of radiusd -v
Facter.add(:freeradius_version) do
setcode do
Facter::Core::Execution.exec('radiusd -v').split(/\n/)[0].match(/FreeRADIUS Version (\d\.\d\.\d)/)[1]
version = Facter::Core::Execution.exec('radiusd -v')
if !version.nil?
version = version.split(/\n/)[0].match(/FreeRADIUS Version (\d\.\d\.\d)/)[1].to_s
end
version
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment