public
Created

TomEE with Puppet

  • Download Gist
init.pp
Puppet
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
# update the (outdated) package list
exec { "update-package-list":
command => "/usr/bin/sudo /usr/bin/apt-get update",
}
 
class java_6 {
 
package { "openjdk-6-jdk":
ensure => installed,
require => Exec["update-package-list"],
}
 
}
 
class tomee {
 
 
file {"/opt/tomee-1.5.1":
ensure => directory,
recurse => true,
} ->
 
exec { "download-tomee" :
command => "/usr/bin/wget http://apache.rediris.es/openejb/openejb-4.5.1/apache-tomee-1.5.1-webprofile.tar.gz -O /tmp/tomee-1.5.1.tar.gz",
creates => "/tmp/tomee-1.5.1.tar.gz",
} ->
 
exec { "unpack-tomee" :
command => "/bin/tar -xzf /tmp/tomee-1.5.1.tar.gz -C /opt/tomee-1.5.1 --strip-components=1",
creates => "/opt/tomee-1.5.1/bin",
}
 
service { "tomee" :
provider => "init",
ensure => running,
start => "/opt/tomee-1.5.1/bin/startup.sh",
stop => "/opt/tomee-1.5.1/bin/shutdown.sh",
status => "",
restart => "",
hasstatus => false,
hasrestart => false,
require => Exec["unpack-tomee"],
}
 
}
 
include java_6
include tomee

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.