Adding type parameters

Type parameters differ from properties in that they don't directly relate to actual discoverable and updatable resources on the underlying system. Rather, they do one of the two following things:

  • Allow you to specify additional informational context for interacting with properties and resources on the underlying system
  • Provide a layer of abstraction allowing you to override the expected behavior on the underlying system

Let's add a source parameter to our new type using the newparam method:

Puppet::Type.newtype(:mynewtype) do   ...   newparam(:source) do   end   ... 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.