lib/facter: Encapsulate Facter setcode
Avoid potential problems, and add setcode only if edploy command is present and executable.
This commit is contained in:
parent
3b7c4fc640
commit
fa6dfdf6d5
@ -17,18 +17,24 @@
|
||||
#
|
||||
Facter.add('edeploy_role_version') do
|
||||
setcode do
|
||||
if File.executable?('/usr/sbin/edeploy')
|
||||
Facter::Util::Resolution.exec('/usr/sbin/edeploy version')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Facter.add('edeploy_role_name') do
|
||||
setcode do
|
||||
if File.executable?('/usr/sbin/edeploy')
|
||||
Facter::Util::Resolution.exec('/usr/sbin/edeploy role')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Facter.add('edeploy_profile') do
|
||||
setcode do
|
||||
if File.executable?('/usr/sbin/edeploy')
|
||||
Facter::Util::Resolution.exec('/usr/sbin/edeploy profile')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user