On Tuesday, March 4, 2014 11:17:48 AM UTC-6, bluethundr wrote: > > Hey all, > > I'm attempting to setup some defaults to my postfix 'config' class to > require a package and request a refresh of the postfix service. > > This is my class definition: > > class postfix::config { > $require = Class["postfix::install"] > $notify = Class["postfix::service"] > > File { > owner => "postfix", > group => "postfix", > mode => 0644, > } > > file { "/etc/postfix/master.cf": > ensure => present, > source => "puppet:///modules/postfix/master.cf", > } > > file { "/etc/postfix/main.cf": > ensure => present, > content => template("postfix/main.cf.erb"), > } > } > > > But I notice that if I create a situation where the service _should_ be > refreshed (like by moving the main.cf file out of the way and doing a > puppet run) the service is not cycled. > > Can anyone point out where I'm going wrong with my syntax in this class > definition? > >
You are initializing class variables $postfix::config::require and $postfix::config::notify with class references, but that has no special meaning to Puppet. In particular, those class variables are not related to the 'require' and 'notify' metaparameters that all classes and resources provide (and if they were then you wouldn't be able to assign values to them inside the class body). My best translation of your apparent intent into effective Puppet code would be this: Class['postfix::install'] -> Class['postfix::config'] Class['postfix::config'] ~> Class['postfix::service'] . That which can be shortened to this: Class['postfix::install'] -> Class['postfix::config'] ~> Class['postfix::service'] Put one of those in your class in place of the variable declarations, or else pull it up to a higher level (e.g. in class 'postfix', if that exists and can be assumed to have been declared). John -- 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/bdafaa29-09cf-44d4-9236-409e729c0e9f%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.