summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppetlabs.com>2015-09-24 10:55:39 -0700
committerHunter Haugen <hunter@puppetlabs.com>2015-09-24 10:55:39 -0700
commit4d1bca3359519e6303d9b3543c56426606c8eba3 (patch)
tree191c693fe813e56c678ee0cdb0454cf45335bf4f /lib
parent6bb1c27b99e9ae783afda652c454664c83bbfa61 (diff)
parent66e118a92aa480739f62e4675ed80c79ef80619c (diff)
downloadpuppet-stdlib-4d1bca3359519e6303d9b3543c56426606c8eba3.tar.gz
puppet-stdlib-4d1bca3359519e6303d9b3543c56426606c8eba3.tar.bz2
Merge pull request #506 from binford2k/feature/service_provider_fact
Add a service_provider fact
Diffstat (limited to 'lib')
-rw-r--r--lib/facter/service_provider.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/facter/service_provider.rb b/lib/facter/service_provider.rb
new file mode 100644
index 0000000..54db937
--- /dev/null
+++ b/lib/facter/service_provider.rb
@@ -0,0 +1,14 @@
+# Fact: service_provider
+#
+# Purpose: Returns the default provider Puppet will choose to manage services
+# on this system
+#
+# Resolution: Instantiates a dummy service resource and return the provider
+#
+# Caveats:
+#
+Facter.add(:service_provider) do
+ setcode do
+ Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s
+ end
+end