Adding additional type properties

Type properties are attributes that reflect the current state of that resource on the underlying operating system.

During the Puppet run, these values are actively enforced, so they should be both discoverable and updatable. If the attribute can't be updated, it could be implemented as a read-only property. In the following code, we are extending our example type's interface to define a version property:

Puppet::Type.newtype(:mynewtype) do   ...   mynewproperty(:version) do   end   ... end

Now we start to use that property in the Puppet DSL, as shown in the following code:

mynewtype{ 'foo':   version => '2.2', }

But it won't allow the catalog to compile yet, since there's no implementation for that property in any ...

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.