I noticed the require 'class' function has made 0.25.  I've been
having some issues appending to arrays (order of execution I believe)
and wondered if this would now work -

node 'a' {
include webserver, database, stats

# stats.pp
$mystat1 = []

class stats {
  if tagged('webserver') {
    require webserver::stats      # used to be include
  }
  if tagged('database') {
    require database::stats      # used to be include
  }

if mystat1 != [] {
  deploystats()
}

define deploystats() # the array mystat1is used in the $myfile.erb
  file { "/stats/$myfile" :
                        ensure  => present,
                        content => template("module/$myfile.erb"),
                        notify  => Service["statservice"],
        }

# webserver.pp
class webserver::stats {
    $mystat1 += ["processName"]
}

# database.pp
class database::stats {
    $mystat1 += ["processName"]
}

After writing the above i'm guessing it still won't quite work as the
deploystats() could still get called before the 'if tagged' statements
get seen?!

If thats the case then I guess my options are either too add a new
type that modifies the files, or use augeas?

Thanks,

Matt

--~--~---------~--~----~------------~-------~--~----~
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