Add os_service_default fact
This change adds a custom fact called os_service_default, for use with the openstack modules to provide the '<SERVICE DEFAULT>' string for configurations. Static external facts can be loaded from <MODULEPATH>/<MODULE>/facts.d/ starting with Puppet 3.4/Facter 2.0.1. Prior to this change, the static facts needed to be placed in an environment specific location. For Facter < 2.0.1, we are providing a regular ruby fact. Change-Id: Id6eec6f96d545bb0054aad30bf359cf32521c83a
This commit is contained in:
parent
f189ec154a
commit
989d8e999a
|
@ -0,0 +1 @@
|
|||
os_service_default='<SERVICE DEFAULT>'
|
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# This adds the os_service_default fact for people with facter < 2.0.1
|
||||
# For people with facter >= 2.0.1, the facts.d/os_services_default.txt should
|
||||
# provide this information
|
||||
#
|
||||
require 'puppet/util/package'
|
||||
|
||||
if Puppet::Util::Package.versioncmp(Facter.value(:facterversion), '2.0.1') < 0
|
||||
Facter.add('os_service_default') do
|
||||
setcode do
|
||||
'<SERVICE DEFAULT>'
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue