What I did with tomcat and .war webapps is to create a system package with an unpacked war, and then process the conf files. I havenโt dealt with Weblogic or JBoss at all, so I donโt know how this relates to the WAR deployable topic.
1) Create a package (RPM) where I make all the building materials .war, and then something like:
mkdir -p %{buildroot}/var/lib/tomcat5/webapps/APP cd %{buildroot}/var/lib/tomcat5/webapps/APP unzip ../APP.war rm ../APP.war
(so the unzipped .war file is in the package without the actual .war file there. Using tomcat, it will leave this directory separately, especially if it does not have write permission, because the files are owned by root)
2) The doll material is somewhat reminiscent of:
package { "tomcat5": require => Package["java-1.6.0-sun"], ensure => installed; "java-1.6.0-sun": ensure => installed; "APP": ensure => installed, notify => Service["tomcat5"], require => Package["java-1.6.0-sun"]; } file { "/usr/share/tomcat5/webapps/APP": source => [ "puppet:///MODULE/APP" ], ensure => directory, ignore => [ 'CVS', '.git', '.svn', '*~' ],
This particular package contains 32 files in 8 directories, which we modify or pop to configure it. If it were just a few files, I would use a couple of simple file{}
resources to manage these files instead of recursive material.
If you do not want to create a system-type package, you can make the file{}
resource for war in an alternative directory, exec{"unzip ...": creates => '/path/to/unzipped/webapp;}
and have the resources file{}
for configurations requiring Exec["unzip ..."]
.