Maybe I''m going a little nuts, this behaviour seems odd to me (and inconsistent). I have a puppet class like this: class puppet::config { File { owner => "puppet", notify => Service["puppet"], } file { "/etc/puppet/puppet.conf": content => template("puppet/puppet.conf"), } } Great - when puppet.conf changes, puppet is restarted. And a puppetserver class like this: class puppetserver::config ($puppetserver_db_hostname = "localhost", $puppetserver_db_password, $puppetserver_autosign = []) inherits puppet::config{ File { owner => "puppet", } File["/etc/puppet/puppet.conf"] { content => template("puppet/puppet.conf","puppetserver/ puppet.conf"), mode => 0600, } Puppet is still restarted, let''s add puppetserver in for a full restart: File { owner => "puppet", } File["/etc/puppet/puppet.conf"] { content => template("puppet/puppet.conf","puppetserver/ puppet.conf"), notify +> Service["puppetserver"], mode => 0600, } Hmm, that just restarts puppetserver, not puppet anymore :-( Hmm, maybe it''s picking up the local File defaults, so let''s try: File { owner => "puppet", notify => Service["puppetserver"], } File["/etc/puppet/puppet.conf"] { content => template("puppet/puppet.conf","puppetserver/ puppet.conf"), notify +> Service["puppet"], mode => 0600, } Now it''s just reloading puppet and not puppetmaster so it''s can''t be that (and it''s at this point that I''m thinking that this isn''t intended behaviour). For now I''ve put in a: notify => [Service["puppet"],Service["puppetserver"]], -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
> File { > owner => "puppet", > notify => Service["puppetserver"], > } > File["/etc/puppet/puppet.conf"] { > content => template("puppet/puppet.conf","puppetserver/ > puppet.conf"), > notify +> Service["puppet"], > mode => 0600, > }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"] } } leading to a notify list of Service["bar", "baz"] in the subclass. Note that you have not used inheritance in your manifest at all! 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. Cheers, Felix -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
On 01/17/2011 02:52 PM, Adrian Bridgett wrote:> Hi Frank,"Felix".> then overridden here: > > class puppetserver::config inherits puppet::config{Oops - sorry, I completely missed that inherits clause in your previous mail. Also your override syntax. *facepalm*>> 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"]".I should have added "that''s what I infer and what seems sort of logical to me.">> 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).I agree about exploiting resource defaults where possible, but apparently they don''t play nice with plusignment overrides, as you noticed here. It would be interesting to see whether repeating the notify parameter in your file { } declaration (in redundance with the default you declare) fixes your problem. Cheers, Felix -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.