i'm trying to install and deploy glassfish application using puppet in
a master agent mode. i'm able to download files from the master and
unzip them, configure etc ...  the last two steps are to start the
glassfish service and deploy war file. i haven't been able to deploy
the war file so far as puppet always fails with:

err: /Stage[main]/Glassfish::App/Exec[deploy app.war]/returns: change
from notrun to 0 failed: /tmp/appdeploy.sh returned 1 instead of one
of [0] at /etc/puppet/modules/glassfish/manifests/app.pp:

glassfish service starts but the deployment itself fails. The script
simply tries to:

#!/bin/bash
service glassfish start
sleep 2
/opt/glassfish3/bin/asadmin deploy --port 4949 --contextroot "/" /tmp/
app.war

I have one simple class


class glassfish {
    file { "/tmp/glassfish.zip":
         source => "puppet:///modules/glassfish/glassfish-3.1.1.zip",
    }

    exec { "unzip glassfish":
        command => "/usr/bin/unzip /tmp/glassfish.zip -d /opt",
        require => [File["/tmp/glassfish.zip"],Package["unzip"]],
    }

    file { "/etc/init.d/glassfish":
        source => "puppet:///modules/glassfish/glassfish",
        mode   => 755,
        owner  => "root",
        group  => "root",
    }

    exec { "add initscript glassfish":
        command => "/sbin/chkconfig --level 35 glassfish on",
        require => File["/etc/init.d/glassfish"],
    }

    file { "/tmp/app.war":
        source => "puppet:///modules/glassfish/app.war",
    }

    file { "/tmp/appdeploy.sh":
        source => "puppet:///modules/glassfish/appdeploy.sh",
    }

    exec { "deploy app.war":
        command => "/tmp/appdeploy.sh",
        require => [File["/tmp/app.war"],File["/tmp/appdeploy.sh"]],
    }
}

if i execute the script manually after puppet has failed it deploys
the app successfully. i'm running puppet-2.7.9-1.el5.rf.noarch on
centos 5.4 and jdk is jdk-1.6.0_22-fcs. i'm relatively new to puppet
but thought this should've worked?

Thanks.

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