Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active January 2, 2016 16:39
Show Gist options
  • Save raphink/8331517 to your computer and use it in GitHub Desktop.
Save raphink/8331517 to your computer and use it in GitHub Desktop.

Adding an augeasproviders features would help to distribute the lib properly without using ../../.. hacks...

Puppet.features.add(:augeasproviders, :libs => ["augeasproviders"])
if Puppet.features.augeasproviders?
require 'augeasproviders'
else
# Fallback method (/!\ if multiple module paths)
# Will that even works, since the provider is confined to the feature?
require File.dirname(__FILE__) + '/../../../../augeasproviders/provider'
end
Puppet::Type.type(:sometype).provide(:augeas) do
include AugeasProviders::Provider
confine :feature => :augeasproviders
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment