Browse Source

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
changes/50/229050/2
Alex Schultz 6 years ago
parent
commit
989d8e999a
  1. 1
      facts.d/os_service_default.txt
  2. 14
      lib/facter/os_service_default.rb

1
facts.d/os_service_default.txt

@ -0,0 +1 @@
os_service_default='<SERVICE DEFAULT>'

14
lib/facter/os_service_default.rb

@ -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…
Cancel
Save