Hi Gavin,

On Fri, Oct 19, 2012 at 9:35 AM, Gavin Williams <fatmc...@gmail.com> wrote:
> Ok, I've found what was causing the provider to fail...
>
> Changed as follows:
>
> 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 = []
>
> Any ideas how I can make commands use a variable?
>
> Cheers
> Gavin
>
> On Monday, 15 October 2012 11:40:16 UTC+1, Gavin Williams wrote:
>>
>> 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 <fatmc...@gmail.com> wrote:
>>>
>>> Stefan
>>>
>>> Yes, the code is all in github.
>>> https://github.com/fatmcgav/puppet-glassfish
>>>
>>> Cheers
>>> Gav
>>>
>>> On Sep 29, 2012 1:28 AM, "Stefan Schulte"
>>> <stefan.schu...@taunusstein.net> wrote:
>>>>
>>>> On Fri, Sep 28, 2012 at 10:39:11AM +0100, fatmcgav wrote:
>>>> > Ok, so I thought I'd take another look, and try and get some debug
>>>> > logging
>>>> > out of the provider to make sure it's constructing things correctly...
>>>> >
>>>> > I've applied the following patch to asadmin.rb, however I'm not seeing
>>>> > anything on the client trace...
>>>> >
>>>> > 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
>>>> > >
>>>> >
>>>> > Any ideas how I can get the provider logging???
>>>> >
>>>> > Cheers
>>>> > Gavin
>>>> >
>>>>
>>>> do you have the code somewhere? If you dropped the debug call in the
>>>> create method or something it will never be executed if puppet thinks
>>>> the provider is not valid at all.
>>>>
>>>> So having the actual provider code may make is more obvious why it is
>>>> failing for you.
>>>>
>>>> -Stefan
>>>>
>>>> --
>>>> 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.
>>>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/hGGzpUwCUxsJ.
>
> 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.

Puppet uses its `path` setting to resolve unqualified executables in
commands[1]. You can specify this on a per-agent basis, or you can
provide an environment or I've recently filed a ticket to add a
per-resource path metaparameter[2]. If you're writing your own
provider, you can also specify an environment that puppet will use to
execute the child process.

Josh

[1] http://docs.puppetlabs.com/references/latest/configuration.html#path
[2] http://projects.puppetlabs.com/issues/16997
-- 
Josh Cooper
Developer, Puppet Labs

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