diff --git a/lib/puppet/provider/jvmoption/asadmin.rb b/lib/puppet/provider/jvmoption/asadmin.rb deleted file mode 100644 index ac64299..0000000 --- a/lib/puppet/provider/jvmoption/asadmin.rb +++ /dev/null @@ -1,42 +0,0 @@ -$LOAD_PATH.unshift(File.join(File.dirname(__FILE__),"..","..","..")) -require 'puppet/provider/asadmin' - -Puppet::Type.type(:jvmoption).provide(:asadmin, :parent => -Puppet::Provider::Asadmin) do - desc "Glassfish jvm-options support." - def create - args = Array.new - args << "create-jvm-options" - args << "--target" << @resource[:target] if @resource[:target] - args << "'" + escape(@resource[:name]) + "'" - - asadmin_exec(args) - end - - def destroy - args = Array.new - args << "delete-jvm-options" - args << "--target" << @resource[:target] - args << "'" + escape(@resource[:name]) + "'" - - asadmin_exec(args) - end - - def exists? - args = Array.new - args << "list-jvm-options" - args << "--target" << @resource[:target] if @resource[:target] - - #Remove escaped semi-colons and qoutes for matching the jvm option name - name = @resource[:name].sub "\\:" , ":" - name = name.gsub "\\\"" , "\"" - - asadmin_exec(args).each do |line| - line.sub!(/-XX: ([^\ ]+)/, '-XX:+\1') - if line.match(/^-.[^\ ]+/) - return true if name == line.chomp - end - end - return false - end -end diff --git a/templates/glassfish-init-domain-el.erb b/templates/glassfish-init-domain-el.erb index e644516..2c10dd6 100644 --- a/templates/glassfish-init-domain-el.erb +++ b/templates/glassfish-init-domain-el.erb @@ -13,11 +13,12 @@ GLASSFISH_BIN="<%= scope.lookupvar('glassfish::glassfish_dir') %>/glassfish/bin" # Setup Domain and User values DOMAIN="<%= @domain_name %>" +PWFILE="<%= @asadmin_passfile %>" USER="<%= @runuser %>" start() { echo -n "Starting glassfish domain $DOMAIN: " - daemon --user $USER --pidfile /var/run/glassfish_$DOMAIN.pid "$GLASSFISH_BIN/asadmin start-domain $DOMAIN" + daemon --user $USER --pidfile /var/run/glassfish_$DOMAIN.pid "$GLASSFISH_BIN/asadmin start-domain --passwordfile $PWFILE $DOMAIN" RETVAL=$? if [ $RETVAL -eq 0 ]; then PID=`ps U $USER | grep $DOMAIN | awk '{ print $1}'`