Puppet providers are notoriously difficult to debug. Sure, errors will be shown, and you'll get some debug output if you run
puppet agent --test --debug. However, more often than not things will fail silently or the error message won't be indicative of the actual issue. Same goes for the debug output. Not to mention that Puppet agent debug output is very verbose.
Something that I see more or less frequently is that the debug output shows an external command being executed, but no indication that the execution of the command actually failed, or why.
What you can do is add some output statements to your provider code. Unfortunately this isn't very well documented, but the
Puppet class provides several methods that can be used for this purpose (one for every log level listed here):
debug() messages are only shown when running
puppet agent --test --debug, the others are displayed in the "regular" output (
puppet agent --test).
A method in your provider could for instance look somewhat like this:
output = execute(['command', '--with', 'arguments'])
Puppet.notice(output) unless output.nil?
rescue Puppet::ExecutionFailure => e