The Puppet ecosystem, which is over 10 years old now, was originally written in Ruby.
There has been a lot of progress made toward moving the main code base to the Clojure language (especially the main Puppet Server and PuppetDB components); however, there are still several parts of the ecosystem that can still be accessed at the Ruby level for the purposes of extending Puppet to suit more advanced use cases, namely the following:
- Custom facts
- Custom functions
- Types and providers
Let's consider each of these in turn, and see how we can extend Puppet on both the client and server side using firstly some rudimentary and then later some more advanced understanding of Ruby code.