On Jan 17, 1:12 pm, Felix Frank <felix.fr...@alumni.tu-berlin.de>
wrote:
[snip]

Hi Frank,

> I disbelieve that's how you are supposed to use this plusignment syntax.
> This is how I'm used to seeing it:
>
> class puppet::config {
>   file { "foo": notify => Service["bar"] }
>
> }
>
> class puppet::config::server inherits puppet::config {
>   File["foo"] { notify +> Service["baz"] }
>
> }

I effectively have that - removing some of the extra bits I have:

class puppet::config {
...
  file {
    "/etc/puppet/puppet.conf":
    content => template("puppet/puppet.conf"),
  }
}

then overridden here:

class puppetserver::config inherits puppet::config{
...
  File["/etc/puppet/puppet.conf"] {
    content => template("puppet/puppet.conf","puppetserver/
puppet.conf"),
    notify +> Service["puppetserver"],
  }
}

> Also note that resource defaults become mute if you assign *any*
> parameter value in an actual instance declaration. So
>
> File { notify => Service["foo"] }
> file { "baz": notify +> Service["bar"] }
>
> doesn't mean "enhance the default by Service["bar"]", but instead it
> means "replace the default by whatever was set *for this very file* plus
> Service["bar"]".
>
> As an aside, I try and steer clear of plusignment whenever it's possible.

Ah, interesting - I hadn't appreciated that, it seems a bit of a shame
in some ways.  That explains what I'm seeing.

One reason for the slight oddness here and setting defaults was to all
a more standardised approach in how we write modules - to avoid
missing notifies (or conversely too many).

Thanks,

Adrian

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to