summaryrefslogtreecommitdiff
path: root/lib/facter
diff options
context:
space:
mode:
Diffstat (limited to 'lib/facter')
-rw-r--r--lib/facter/package_provider.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/facter/package_provider.rb b/lib/facter/package_provider.rb
new file mode 100644
index 0000000..9a4ec65
--- /dev/null
+++ b/lib/facter/package_provider.rb
@@ -0,0 +1,17 @@
+# Fact: package_provider
+#
+# Purpose: Returns the default provider Puppet will choose to manage packages
+# on this system
+#
+# Resolution: Instantiates a dummy package resource and return the provider
+#
+# Caveats:
+#
+require 'puppet/type'
+require 'puppet/type/package'
+
+Facter.add(:package_provider) do
+ setcode do
+ Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
+ end
+end