FAQ
Hi there,

I'm trying to setup Glassfish config management using puppet.
I've found larstobi's module here
<https://github.com/larstobi/puppet-glassfish/>which I've cloned and am
starting to tweak, as it would appear that the mentioned module is based on
Solaris, therefore I'm starting to add support for EL. My code tree is here<https://github.com/fatmcgav/puppet-glassfish>
.

The challenge I'm hitting currently is that upon executing, it's failing
with
*err: Could not find a suitable provider for domain*
When running at debug level, I can see the following:
*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
*

I've verified that the asadmin file exists, as follows:
*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
*
So the file definitely exists, and is a valid 'asadmin' file.

Any ideas?

Cheers
Gavin

--
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/-/A_85G-eU3TwJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Dick Davies at Sep 27, 2012 at 11:53 am
    At a guess the asadmin command isn't in puppetd's $PATH.
    Maybe try a full path to the executable to confirm?
    On 26 September 2012 17:01, Gavin Williams wrote:
    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here which I've cloned and am starting to
    tweak, as it would appear that the mentioned module is based on Solaris,
    therefore I'm starting to add support for EL. My code tree is here.

    The challenge I'm hitting currently is that upon executing, it's failing
    with
    err: Could not find a suitable provider for domain

    When running at debug level, I can see the following:
    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

    I've verified that the asadmin file exists, as follows:
    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

    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin

    --
    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/-/A_85G-eU3TwJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Sep 27, 2012 at 11:57 am
    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
    On Sep 27, 2012 12:53 PM, "Dick Davies" wrote:

    At a guess the asadmin command isn't in puppetd's $PATH.
    Maybe try a full path to the executable to confirm?
    On 26 September 2012 17:01, Gavin Williams wrote:
    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here which I've cloned and am starting to
    tweak, as it would appear that the mentioned module is based on Solaris,
    therefore I'm starting to add support for EL. My code tree is here.

    The challenge I'm hitting currently is that upon executing, it's failing
    with
    err: Could not find a suitable provider for domain

    When running at debug level, I can see the following:
    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

    I've verified that the asadmin file exists, as follows:
    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

    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin

    --
    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/-/A_85G-eU3TwJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Stefan Schulte at Sep 28, 2012 at 5:11 am

    On Thu, Sep 27, 2012 at 12:57:01PM +0100, fatmcgav wrote:
    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
    On Sep 27, 2012 12:53 PM, "Dick Davies" wrote:
    [...]
    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
    [...]

    Has the file the executable bit set for the user that is running the
    script (probably root)?

    -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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Sep 28, 2012 at 7:58 am
    Stefan

    Was running puppet agent using 'sudo'...

    However just tried using root and no difference...

    Asadmin definitely exists and has got the right permissions, as shown below:

    # 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
    Thoughts?

    Cheers
    Gavin

    On 28 September 2012 06:14, Stefan Schulte
    wrote:
    On Thu, Sep 27, 2012 at 12:57:01PM +0100, fatmcgav wrote:
    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
    On Sep 27, 2012 12:53 PM, "Dick Davies" wrote:
    [...]
    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
    [...]

    Has the file the executable bit set for the user that is running the
    script (probably root)?

    -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+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Sep 28, 2012 at 9:39 am
    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
    On 28 September 2012 08:58, fatmcgav wrote:

    Stefan

    Was running puppet agent using 'sudo'...

    However just tried using root and no difference...

    Asadmin definitely exists and has got the right permissions, as shown
    below:

    # 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
    Thoughts?

    Cheers
    Gavin

    On 28 September 2012 06:14, Stefan Schulte <stefan.schulte@taunusstein.net
    wrote:
    On Thu, Sep 27, 2012 at 12:57:01PM +0100, fatmcgav wrote:
    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
    On Sep 27, 2012 12:53 PM, "Dick Davies" <rasputnik@hellooperator.net> wrote:
    [...]
    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
    [...]

    Has the file the executable bit set for the user that is running the
    script (probably root)?

    -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+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Stefan Schulte at Sep 29, 2012 at 12:28 am

    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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Sep 29, 2012 at 7:21 am
    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" 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+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Oct 15, 2012 at 10:46 am
    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 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" 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+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Gavin Williams at Oct 19, 2012 at 7:24 pm
    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 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.schulte@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+unsubscribe@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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Josh Cooper at Oct 19, 2012 at 6:41 pm
    Hi Gavin,
    On Fri, Oct 19, 2012 at 9:35 AM, Gavin Williams 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 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"
    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+unsubscribe@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+unsubscribe@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+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Oct 21, 2012 at 2:39 pm
    Josh

    Cheers for the info.
    Are there any references on how to set the path when executing child
    processes?

    Cheers
    Gavin
    On Oct 19, 2012 6:03 PM, "Josh Cooper" wrote:

    Hi Gavin,
    On Fri, Oct 19, 2012 at 9:35 AM, Gavin Williams 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 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"
    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+unsubscribe@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+unsubscribe@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+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Gavin Williams at Oct 24, 2012 at 10:38 am
    Ok, I've gone about it a slightly different way now, and have stripped the
    'commands' argument from the domain function provider, and am trying to
    validate the presence of asadmin at the main asadmin.rb level.

    I've created an 'exists?' definition, but it doesn't appear to be getting
    called. Any ideas how I can force it to be called prior to attempting to
    execute asadmin?

    Latest code commit has been pushed to github, available here:
    https://github.com/fatmcgav/puppet-glassfish/commit/429f9e8e1d08e99c69d8ffdcb3043648af5fa18a

    Any comments welcome.

    Regards
    Gavin
    On Wednesday, 26 September 2012 17:01:47 UTC+1, Gavin Williams wrote:

    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here
    <https://github.com/larstobi/puppet-glassfish/>which I've cloned and am
    starting to tweak, as it would appear that the mentioned module is based on
    Solaris, therefore I'm starting to add support for EL. My code tree is
    here <https://github.com/fatmcgav/puppet-glassfish>.

    The challenge I'm hitting currently is that upon executing, it's failing
    with
    *err: Could not find a suitable provider for domain*
    When running at debug level, I can see the following:
    *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
    *

    I've verified that the asadmin file exists, as follows:
    *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
    *
    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin
    --
    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/-/_pJvxmzaEmUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Stefan Schulte at Oct 24, 2012 at 5:15 pm

    On Wed, Oct 24, 2012 at 03:38:20AM -0700, Gavin Williams wrote:
    Ok, I've gone about it a slightly different way now, and have stripped the
    'commands' argument from the domain function provider, and am trying to
    validate the presence of asadmin at the main asadmin.rb level.

    I've created an 'exists?' definition, but it doesn't appear to be getting
    called. Any ideas how I can force it to be called prior to attempting to
    execute asadmin?

    Latest code commit has been pushed to github, available here:
    https://github.com/fatmcgav/puppet-glassfish/commit/429f9e8e1d08e99c69d8ffdcb3043648af5fa18a

    Any comments welcome.

    Regards
    Gavin
    Your exists? method in puppet/provider/domain/el.rb overwrites the
    exists? method in puppet/provider/asadmin.rb. I don't know if you get
    problems when you have an el.rb file but you define an asadmin provider
    here. This may create classname clashes with the asadmin provider defined in
    provider/asadmin.rb

    The exists? method in asadmin.rb is not going to work because `commands`
    is a class method while `exists` is an instance method. It does make no
    sense to call `commands` inside an instance method.

    What exactly are you trying to archive anyhow? If the excutable is not in
    PATH how should your provider work? The best approach in my opinion
    is to always specify the full path to the executable. If you want your
    provider considered suitable even if commands are missing, you can use

       optional_commands :asadmin => 'binary_that_may_be_absent'

    If you want the user to supply the path to the binary via a resource
    parameter then you cannot realize this at a class level but at an
    instance level. That beeing said, you cannot define your executables
    with use the `commands` method.

    To execute something you can use the execute method. You then have to
    do something like.

       output = execute([resource[:asadmin_binary], "arg1", "arg2"])

    -Stefan
    On Wednesday, 26 September 2012 17:01:47 UTC+1, Gavin Williams wrote:

    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here
    <https://github.com/larstobi/puppet-glassfish/>which I've cloned and am
    starting to tweak, as it would appear that the mentioned module is based on
    Solaris, therefore I'm starting to add support for EL. My code tree is
    here <https://github.com/fatmcgav/puppet-glassfish>.

    The challenge I'm hitting currently is that upon executing, it's failing
    with
    *err: Could not find a suitable provider for domain*
    When running at debug level, I can see the following:
    *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
    *

    I've verified that the asadmin file exists, as follows:
    *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
    *
    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin
    --
    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/-/_pJvxmzaEmUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Fatmcgav at Oct 24, 2012 at 8:36 pm
    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
    On Oct 24, 2012 6:15 PM, "Stefan Schulte" wrote:
    On Wed, Oct 24, 2012 at 03:38:20AM -0700, Gavin Williams wrote:
    Ok, I've gone about it a slightly different way now, and have stripped the
    'commands' argument from the domain function provider, and am trying to
    validate the presence of asadmin at the main asadmin.rb level.

    I've created an 'exists?' definition, but it doesn't appear to be getting
    called. Any ideas how I can force it to be called prior to attempting to
    execute asadmin?

    Latest code commit has been pushed to github, available here:
    https://github.com/fatmcgav/puppet-glassfish/commit/429f9e8e1d08e99c69d8ffdcb3043648af5fa18a
    Any comments welcome.

    Regards
    Gavin
    Your exists? method in puppet/provider/domain/el.rb overwrites the
    exists? method in puppet/provider/asadmin.rb. I don't know if you get
    problems when you have an el.rb file but you define an asadmin provider
    here. This may create classname clashes with the asadmin provider defined
    in
    provider/asadmin.rb

    The exists? method in asadmin.rb is not going to work because `commands`
    is a class method while `exists` is an instance method. It does make no
    sense to call `commands` inside an instance method.

    What exactly are you trying to archive anyhow? If the excutable is not in
    PATH how should your provider work? The best approach in my opinion
    is to always specify the full path to the executable. If you want your
    provider considered suitable even if commands are missing, you can use

    optional_commands :asadmin => 'binary_that_may_be_absent'

    If you want the user to supply the path to the binary via a resource
    parameter then you cannot realize this at a class level but at an
    instance level. That beeing said, you cannot define your executables
    with use the `commands` method.

    To execute something you can use the execute method. You then have to
    do something like.

    output = execute([resource[:asadmin_binary], "arg1", "arg2"])

    -Stefan
    On Wednesday, 26 September 2012 17:01:47 UTC+1, Gavin Williams wrote:

    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here
    <https://github.com/larstobi/puppet-glassfish/>which I've cloned and
    am
    starting to tweak, as it would appear that the mentioned module is
    based on
    Solaris, therefore I'm starting to add support for EL. My code tree is
    here <https://github.com/fatmcgav/puppet-glassfish>.

    The challenge I'm hitting currently is that upon executing, it's
    failing
    with
    *err: Could not find a suitable provider for domain*
    When running at debug level, I can see the following:
    *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
    *

    I've verified that the asadmin file exists, as follows:
    *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
    *
    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin
    --
    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/-/_pJvxmzaEmUJ.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to
    puppet-users+unsubscribe@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 post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
  • Sans at Oct 6, 2014 at 8:18 pm
    Hi Gavin,

    I know it's almost a 2 yrs. old thread but I'm still getting the very same "*Could
    not find a suitable provider for domain*" error. Did you able to solve the
    this prob at all in the end?

    Best!

    On Wednesday, October 24, 2012 9:36:33 PM UTC+1, Gavin Williams wrote:

    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
    On Oct 24, 2012 6:15 PM, "Stefan Schulte" <stefan....@taunusstein.net
    <javascript:>> wrote:
    On Wed, Oct 24, 2012 at 03:38:20AM -0700, Gavin Williams wrote:
    Ok, I've gone about it a slightly different way now, and have stripped the
    'commands' argument from the domain function provider, and am trying to
    validate the presence of asadmin at the main asadmin.rb level.

    I've created an 'exists?' definition, but it doesn't appear to be getting
    called. Any ideas how I can force it to be called prior to attempting to
    execute asadmin?

    Latest code commit has been pushed to github, available here:
    https://github.com/fatmcgav/puppet-glassfish/commit/429f9e8e1d08e99c69d8ffdcb3043648af5fa18a
    Any comments welcome.

    Regards
    Gavin
    Your exists? method in puppet/provider/domain/el.rb overwrites the
    exists? method in puppet/provider/asadmin.rb. I don't know if you get
    problems when you have an el.rb file but you define an asadmin provider
    here. This may create classname clashes with the asadmin provider defined
    in
    provider/asadmin.rb

    The exists? method in asadmin.rb is not going to work because `commands`
    is a class method while `exists` is an instance method. It does make no
    sense to call `commands` inside an instance method.

    What exactly are you trying to archive anyhow? If the excutable is not in
    PATH how should your provider work? The best approach in my opinion
    is to always specify the full path to the executable. If you want your
    provider considered suitable even if commands are missing, you can use

    optional_commands :asadmin => 'binary_that_may_be_absent'

    If you want the user to supply the path to the binary via a resource
    parameter then you cannot realize this at a class level but at an
    instance level. That beeing said, you cannot define your executables
    with use the `commands` method.

    To execute something you can use the execute method. You then have to
    do something like.

    output = execute([resource[:asadmin_binary], "arg1", "arg2"])

    -Stefan
    On Wednesday, 26 September 2012 17:01:47 UTC+1, Gavin Williams wrote:

    Hi there,

    I'm trying to setup Glassfish config management using puppet.
    I've found larstobi's module here
    <https://github.com/larstobi/puppet-glassfish/>which I've cloned and
    am
    starting to tweak, as it would appear that the mentioned module is
    based on
    Solaris, therefore I'm starting to add support for EL. My code tree is
    here <https://github.com/fatmcgav/puppet-glassfish>.

    The challenge I'm hitting currently is that upon executing, it's
    failing
    with
    *err: Could not find a suitable provider for domain*
    When running at debug level, I can see the following:
    *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
    *

    I've verified that the asadmin file exists, as follows:
    *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
    *
    So the file definitely exists, and is a valid 'asadmin' file.

    Any ideas?

    Cheers
    Gavin
    --
    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/-/_pJvxmzaEmUJ.
    To post to this group, send email to puppet...@googlegroups.com
    <javascript:>.
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    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 post to this group, send email to puppet...@googlegroups.com
    <javascript:>.
    To unsubscribe from this group, send email to
    puppet-users...@googlegroups.com <javascript:>.
    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 unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9ce4c89d-4f47-4884-854d-e3c916e388a7%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Sans at Oct 6, 2014 at 8:18 pm
    Hi Gavin,

    I know it's almost a 2 yrs. old thread but I'm still getting the very same "*Could
    not find a suitable provider for domain*" error. Did you able to solve the
    this prob at all in the end?

    Best!

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ae1ca1c2-36ca-4248-9a16-634eb364c4d3%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 26, '12 at 4:02p
activeOct 6, '14 at 8:18p
posts17
users5
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase