--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
What you want to do is introduce a well-known, if artificial,
"synchronization" resource. In the simplest case this can be a stupid
stamp file:
| package { jboss: ... }
|
| application {
| app1: ..
| require => Package[jboss],
| before => File[/tmp/stamp];
| app2: ..
| require => Package[jboss],
| before => File[/tmp/stamp];
| app3: ..
| require => Package[jboss],
| before => File[/tmp/stamp];
| }
|
| file {
| "/tmp/stamp":
| }
|
| service {
| jboss1:
| require => File[/tmp/stamp];
| jboss2:
| require => File[/tmp/stamp];
| jboss3:
| require => File[/tmp/stamp];
| }
You can put the stamp file in a class that you include everywhere you
need to reference it. That way you can avoid all corner cases (like zero
applications). The other resources can be placed into classes or defines
without prejudice.
The only thing I'm not sure about, is whether notifications
(notify/subscribe) would propagate through the stamp file. If you need
this, I'd start experimenting with using an Exec with refreshonly instead.
Regards, DavidS
> You can put the stamp file in a class that you include everywhere you
> need to reference it. That way you can avoid all corner cases (like
> zero applications). The other resources can be placed into classes or
> defines without prejudice.
>
> The only thing I'm not sure about, is whether notifications
> (notify/subscribe) would propagate through the stamp file. If you need
I am not sure I see the advantage of this over using a class with the actual resources in it? In that case you also would have no problem with notifications etc not working, you can just notify the class or subscribe to the class and all resources in it will be affected.
Using the separate resource allows one to not care about the location of
the various other parts. Your solution, if I understand it correctly
would require to define all services (which are in this case probably
co-located in a define with the application deployment) within a common
class. This is sounds unpractical to me.
Regards, DavidS
Do you number your jboss instances like above? If so, why not have:
3rdparty-thing { "thingy":
before => "jboss-inst0"
}
service { "jboss-inst0":
before => "jboss-inst1"
}
service { "jboss-inst1":
before => "jboss-inst2"
}
...
service { "jboss-instn":
before => "jboss-inst(n+1)"
}
Then have a "terminator" of sorts (which could be in another define):
service { "jboss-inst(n+1)":
ensure => absent
}
You can do arithmetic with variables, so maybe there's a way to do this?
I don't know the details of your situation, but hopefully this either helps or
spurs another idea.
Cheers,
Eric
--
Eric Gerlach, Network Administrator
Federation of Students
University of Waterloo
p: (519) 888-4567 x36329
e: eger...@feds.uwaterloo.ca