On Thursday, 8 September 2016 07:54:07 UTC-4, amateo wrote:
>
>
>         So I'm thinking the possibility to create my own types extending 
> them. 
> Is there any documentation about extending types. All documentation I 
> have found is about creating a completely new type, but I haven't found 
> any about inheriting an existing one. 
>


You can fairly easily extend a resource or type by wrapping it in a new one 
of your own making.  The concept is similar to inheritance in object 
oriented languages, but the mechanism is a little less sleek.

I'm picking a resource with a small list of attributes to keep the example 
simple, but you can do this with anything.

define my_notify (
  $name     => $title,
  $message  => undef,
  $withpath => undef,
  $my_notify_special,
){
  # do custom things here
  notify { $title:
    name     => $name,
    message  => $message,
    withpath => $withpath,
  }
  # do more custom things here, maybe with $my_notify_special
}


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/c8379491-eb4c-4b0c-ba76-ddaadcadc5c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to