Puppet already has a very rich lexicon of built-in resource types (see https://puppet.com/docs/puppet/5.3/type.html), and these have also been extended with additional modules. Windows-specific resource types would be a very good example of where Puppet has had its resource types successfully extended (see https://puppet.com/docs/puppet/5.3/resources_windows_optional.html).
The following are some indications that you may want to consider writing a type and provider as an alternative to regular modules and manifests in Puppet DSL:
- You have several exec statements in your Puppet DSL with convoluted onlyif and unless conditional properties
- Puppet doesn't handle situation very well where:
- Your Puppet DSL is not a powerful-enough API, and you need access to pure Ruby to manipulate data
- Your Puppet DSL code has significant and quite convoluted conditional...