summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBryan Jen <bryan.jen@gmail.com>2015-10-01 10:27:51 -0700
committerBryan Jen <bryan.jen@gmail.com>2015-10-01 10:27:51 -0700
commite1a9bf506359d1e84d13b857ca6fa5e556ceeddd (patch)
tree75792fd62bfddb451b0de6695b873cc2e3c5d002 /lib
parent76db98120acab12d5aab3adaff6d2aa1d970c1e8 (diff)
parentce6e8679b68f984415adc90d74083fd787234709 (diff)
Merge pull request #534 from asasfu/feature/package_provider_fact
Add package_provider fact
Diffstat (limited to 'lib')
-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