Skip to content

Instantly share code, notes, and snippets.

@binford2k
Created August 11, 2015 22:00
Show Gist options
  • Save binford2k/c142ce4b42a2169ffccb to your computer and use it in GitHub Desktop.
Save binford2k/c142ce4b42a2169ffccb to your computer and use it in GitHub Desktop.
Facter.add(:service_provider) do
setcode do
Puppet::Type.type(:service).newservice(:name => 'anyservice')[:provider].to_s
end
end
@asasfu
Copy link

asasfu commented Aug 11, 2015

Thanks binford2k for creating my suggestion in a fact!
-- Speedr on #puppet

It may be useful to consider the function that goes with this fact as well.
https://github.com/sfu-rcg/puppet-sfu_stdlib/blob/master/lib/puppet/parser/functions/default_service_provider_merge.rb
Notes are all written in the rdoc for that function.

Name and methods of the function and fact are all up for discussion to make them more 'proper/conventional'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment