err: Could not find a suitable provider for domain
debug: Puppet::Type::Domain::ProviderAsadmin: file asadmin does not exist
debug: Class[Glassfish::Domain]: The container Stage[main] will propagate my refresh event
err: Could not find a suitable provider for domain
notice: /Stage[main]/Glassfish::Domain/Notify[gfdomain]/message: defined 'message' as 'Creating Glassfish domain cms using portbase 9000.
Asadmin file is: /usr/local/glassfish-3.1.2/bin/asadmin.'
# file /usr/local/glassfish-3.1.2/bin/asadmin
/usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text executable
Hi there
I thought that initially as well, so I modified the provider to use a full path rather than assume it was on the path.
The log files below are prints of the variables which are being passed around...
Cheers
Gav
# file /usr/local/glassfish-3.1.2/bin/asadmin
/usr/local/glassfish-3.1.2/bin/asadmin: POSIX shell script text executable
# ls -l /usr/local/glassfish-3.1.2/bin/asadmin
-rwxr-xr-x. 1 nobody glassfish 2262 Sep 18 16:23 /usr/local/glassfish-3.1.2/bin/asadmin
diff --git a/lib/puppet/provider/asadmin.rb b/lib/puppet/provider/asadmin.rb
index f95d6ab..c8bd4a7 100644
--- a/lib/puppet/provider/asadmin.rb
+++ b/lib/puppet/provider/asadmin.rb
@@ -8,6 +8,7 @@
passed_args.each { |arg| args << arg }
exec_args = args.join " "
command = "#{@resource[:asadminpath]} #{exec_args}"
+ Puppet.debug("Command = #{command}")
command = "su - #{@resource[:user]} -c \"#{command}\"" if @resource[:user] and
not command.match /create-service/
self.debug command
diff --git a/lib/puppet/provider/domain/asadmin.rb b/lib/puppet/provider/domain/asadmin.rb
index 940c051..384f6ab 100644
--- a/lib/puppet/provider/domain/asadmin.rb
+++ b/lib/puppet/provider/domain/asadmin.rb
@@ -2,7 +2,7 @@
Puppet::Type.type(:domain).provide(:asadmin,
:parent => Puppet::Provider::Asadmin) do
desc "Glassfish support."
- commands :asadmin => "asadmin"
+ commands :asadmin => "/usr/local/glassfish-3.1.2/bin/asadmin"
def create
args = []
Just got back from holiday, and need to get this one going...
Any ideas on how I can proceed?
Cheers
Gavin
On 29 September 2012 08:21, fatmcgav <fatm...@gmail.com> wrote:
Stefan
Yes, the code is all in github. https://github.com/fatmcgav/puppet-glassfish
Cheers
Gav
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
Josh
Cheers for the info.
Are there any references on how to set the path when executing child processes?
Cheers
Gavin
Stefan
Cheers for the feedback.
Understood on the exists element.
Yes, what I'm trying to achieve is a working provider without asadmin being in the path. That's what I've worked towards by using a full path to the relevant asadmin file, as it's possible a given node could have one or more versions of glassfish installed.
Currently, the asadmin path gets calculated using several parameter values, which allows a user calling the class to override any given parameter.
The actual command execution appears to work as expected currently, though will take another look at the execute command.
Cheers
Gavin