Creating and distributing the type

The best way to create and distribute a new custom type is to place it into a module, in the puppet/type subdirectory of the lib directory, and it will then be distributed to the agent machine via pluginsync, as we already saw with custom facts in the previous section.

The filename should match the name of the type under development, as shown in the following code:

 <modulepath>/lib/puppet/type/mynewtype.rb  Puppet::Type.newtype(:mynewtype) do ... end

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.