Matt
2011-Sep-19 14:18 UTC
[Puppet Users] Requiring a package to satisfy a provider requirement
Hi there, I''m not sure the subject is entirely clear, so I''ll do my best to explain it here. I''m trying to use the larstobi-puppet-glassfish module to configure Oracle Glassfish. I have the following for a domain: 1 class glassfish::testdomain { 2 domain { 3 "testdomain": 4 user => ''appserv'', 5 asadminuser => ''admin'', 6 passwordfile => ''/opt/glassfish/.aspass'', 7 ensure => ''present'', 8 portbase => ''9001'', 9 require => Package[''glassfish''] 10 } 11 } The problem is that when I run this, the glassfish module causes it all to fail because asadmin, required as a provider, isn''t available, nor is the passwordfile. But then it won''t be available because glassfish isn''t installed. Is there a way to pend the domain item until the glassfish package requirement is satisfied? Thanks Matt -- 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.
John Kennedy
2011-Sep-19 14:52 UTC
Re: [Puppet Users] Requiring a package to satisfy a provider requirement
On Mon, Sep 19, 2011 at 15:18, Matt <matthew.willsher@gmail.com> wrote:> Hi there, > > I''m not sure the subject is entirely clear, so I''ll do my best to > explain it here. > > I''m trying to use the larstobi-puppet-glassfish module to configure > Oracle Glassfish. I have the following for a domain: > > 1 class glassfish::testdomain { > 2 domain { > 3 "testdomain": > 4 user => ''appserv'', > 5 asadminuser => ''admin'', > 6 passwordfile => ''/opt/glassfish/.aspass'', > 7 ensure => ''present'', > 8 portbase => ''9001'', > 9 require => Package[''glassfish''] > 10 } > 11 } > > The problem is that when I run this, the glassfish module causes it > all to fail because asadmin, required as a provider, isn''t available, > nor is the passwordfile. But then it won''t be available because > glassfish isn''t installed. > > Is there a way to pend the domain item until the glassfish package > requirement is satisfied? > > Thanks > Matt > >Would it be possible to create a class to install Glassfish and require that class to be fulfilled before? I actually thought that require => Package[''glassfish''] would have the desired effect... John -- 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.
Matt
2011-Sep-19 15:06 UTC
[Puppet Users] Re: Requiring a package to satisfy a provider requirement
On Sep 19, 3:52 pm, John Kennedy <skeb...@gmail.com> wrote:> > Would it be possible to create a class to install Glassfish and require that > class to be fulfilled before? I actually thought that > require => Package[''glassfish''] > would have the desired effect...That''s what I was expecting but it fails when it can''t find asadmin then if I create a dummy asadmin it files when it can''t find passwordfile. $ puppet apply --modulepath modules/ manifests/test.pp --noop Could not find a default provider for domain $ touch ~/bin/asadmin && chmod +x ~/bin/asadmin $ puppet apply --modulepath modules/ manifests/test.pp --noop Parameter passwordfile failed: /opt/glassfish/.aspass does not exists at /home/matt/devel/puppet/modules/glassfish/manifests/testdomain.pp: 10 $ puppet -V 2.6.9 On a slightly seperate note, I''ve also had to set RUBYLIB to the lib in the module folder as well, which I wasn''t expecting. -- 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.
Matthew Willsher
2011-Sep-20 12:02 UTC
[Puppet Users] Re: Requiring a package to satisfy a provider requirement
On Sep 19, 4:06 pm, Matt <matthew.wills...@gmail.com> wrote:> On Sep 19, 3:52 pm, John Kennedy <skeb...@gmail.com> wrote: > > > > > Would it be possible to create a class to install Glassfish and require that > > class to be fulfilled before? I actually thought that > > require => Package[''glassfish''] > > would have the desired effect... > > That''s what I was expecting but it fails when it can''t find asadmin > then if I create a dummy asadmin it files when it can''t find > passwordfile.Further reading reveals this to be a function of the provider suitability checks. Apparently the use of stages (>=2.6) can be used to resolve this, so there''s my way forward. -- 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.
Matthew Willsher
2011-Sep-20 12:27 UTC
[Puppet Users] Re: Requiring a package to satisfy a provider requirement
On Sep 20, 1:02 pm, Matthew Willsher <matthew.wills...@gmail.com> wrote:> On Sep 19, 4:06 pm, Matt <matthew.wills...@gmail.com> wrote: > > > On Sep 19, 3:52 pm, John Kennedy <skeb...@gmail.com> wrote: > > > > Would it be possible to create a class to install Glassfish and require that > > > class to be fulfilled before? I actually thought that > > > require => Package[''glassfish''] > > > would have the desired effect... > > > That''s what I was expecting but it fails when it can''t find asadmin > > then if I create a dummy asadmin it files when it can''t find > > passwordfile. > > Further reading reveals this to be a function of the provider > suitability checks. Apparently the use of stages (>=2.6) can be used > to resolve this, so there''s my way forward.Sorry to post to my own reply and so soon afterwards, but stages appear not to have resolved this. It seems that the provider tests are done irrespective of stages, so at this point it looks as though it''s not possible to use providers that exist as the result of the action of another resource. -- 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.
Dan Bode
2011-Sep-20 15:31 UTC
Re: [Puppet Users] Re: Requiring a package to satisfy a provider requirement
On Tue, Sep 20, 2011 at 5:27 AM, Matthew Willsher < matthew.willsher@gmail.com> wrote:> > > On Sep 20, 1:02 pm, Matthew Willsher <matthew.wills...@gmail.com> > wrote: > > On Sep 19, 4:06 pm, Matt <matthew.wills...@gmail.com> wrote: > > > > > On Sep 19, 3:52 pm, John Kennedy <skeb...@gmail.com> wrote: > > > > > > Would it be possible to create a class to install Glassfish and > require that > > > > class to be fulfilled before? I actually thought that > > > > require => Package[''glassfish''] > > > > would have the desired effect... > > > > > That''s what I was expecting but it fails when it can''t find asadmin > > > then if I create a dummy asadmin it files when it can''t find > > > passwordfile. > > > > Further reading reveals this to be a function of the provider > > suitability checks. Apparently the use of stages (>=2.6) can be used > > to resolve this, so there''s my way forward. > > Sorry to post to my own reply and so soon afterwards, but stages > appear not to have resolved this. It seems that the provider tests are > done irrespective of stages, so at this point it looks as though it''s > not possible to use providers that exist as the result of the action > of another resource. > > stages were definitely not designed to solve this. It has been a knownissue for a while and has a few work-arounds. The pip provider works around this by not using the commands method, and instead implements lazy pip. Another example of a work around if to create a default provider that does nothing except determine suitability, then you can explicitly specify provider => ''real_provider'' during compile time you can see an example of this approach in the rabbitmq provider https://github.com/puppetlabs/puppetlabs-rabbitmq> -- > 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. > >-- "Join us for PuppetConf <http://bit.ly/puppetconfsig>, September 22nd and 23rd in Portland, OR." <http://bit.ly/puppetconfsig> -- 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
2011-Sep-22 22:41 UTC
Re: [Puppet Users] Re: Requiring a package to satisfy a provider requirement
On Tue, Sep 20, 2011 at 08:31:27AM -0700, Dan Bode wrote:> On Tue, Sep 20, 2011 at 5:27 AM, Matthew Willsher < > matthew.willsher@gmail.com> wrote: > > > > > > > On Sep 20, 1:02 pm, Matthew Willsher <matthew.wills...@gmail.com> > > wrote: > > > On Sep 19, 4:06 pm, Matt <matthew.wills...@gmail.com> wrote: > > > > > > > On Sep 19, 3:52 pm, John Kennedy <skeb...@gmail.com> wrote: > > > > > > > > Would it be possible to create a class to install Glassfish and > > require that > > > > > class to be fulfilled before? I actually thought that > > > > > require => Package[''glassfish''] > > > > > would have the desired effect... > > > > > > > That''s what I was expecting but it fails when it can''t find asadmin > > > > then if I create a dummy asadmin it files when it can''t find > > > > passwordfile. > > > > > > Further reading reveals this to be a function of the provider > > > suitability checks. Apparently the use of stages (>=2.6) can be used > > > to resolve this, so there''s my way forward. > > > > Sorry to post to my own reply and so soon afterwards, but stages > > appear not to have resolved this. It seems that the provider tests are > > done irrespective of stages, so at this point it looks as though it''s > > not possible to use providers that exist as the result of the action > > of another resource. > > > > stages were definitely not designed to solve this. It has been a known > issue for a while and has a few work-arounds. > > The pip provider works around this by not using the commands method, and > instead implements lazy pip. > > Another example of a work around if to create a default provider that does > nothing except determine suitability, then you can explicitly specify > provider => ''real_provider'' during compile time > > you can see an example of this approach in the rabbitmq provider > https://github.com/puppetlabs/puppetlabs-rabbitmq >Another workaround is to use optional_command instead of command which does not add a confine :exists => /path/to/binary. Another one is to add a custom fact that checks the existance of your command and to wrap all your resources inside an if $provider_installed { ... } -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.