Hi,

On 12/20/2011 05:26 PM, Kenneth Lo wrote:
> So the question is, given the service resource is also within the same
> module with the file, how do I make sure we can do the following
> sequentially?: 
> 
> 1. Shutdown the tomcat instance (service resource in tomcat module)
> 2. Update the application war file  (file resource in tomcat module)
> 3. Start the tomcat instance

I'm pretty sure you cannot do that with a single 'tomcat service' resource.

Moreover, you won't be able to build a mechanism for the semantics of
"if the file needs a change, do this thing first", because puppet can
only notify resources *after* the fact.

Is it strictly necessary to kill tomcat before the war file is touched?
If not, just do a single restart after touching the file.

Otherwise, I'd build it like this:

file { "war-file-in-alternate-location": source => ...,
  notify => Exec["deployment-script"]
}

exec { "deployment-script": refreshonly => true, ... }

The "deployment script" is a script you roll via puppet, which will
kill tomcat, copy the newly rolled war file and then start tomcat anew.
Puppet-wise, this is KISSiest way I can think of.

HTH,
Felix

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

Reply via email to