Issue #6907 has been updated by Stefan Schulte.

I wasn't talking about pluginsync. I encountered a problem where a custom 
provider of mine uses the executables of an application I want to install with 
puppet at the same catalog run.

Unfortunately it is not only impossible to do in one run, I am just not able to 
apply the catalog at all.

Here's a simple version of what I mean with a dummy type and provider and 
manifest:
<pre>
/tmp/test/modules/lib/puppet/provider/foo/bar.rb
/tmp/test/modules/lib/puppet/type/foo.rb
/tmp/test/test.pp
</pre>
Now I have the following type:
<pre>
Puppet::Type.newtype(:foo) do
  ensurable

  newparam(:name) do
  end

end
</pre>
And the following provider
<pre>
Puppet::Type.type(:foo).provide(:bar) do
  commands :some_binary => '/tmp/foobinary'

  def exists?
    true
  end
  def create
  end
  def destroy
  end

end
</pre>
Notice that the provider needs a special command. I want to install that 
command with puppet. Simple manifest:
<pre>
foo { 'my_foo_resource':
  ensure => present,
  require => File['/tmp/foobinary']
}
file { '/tmp/foobinary':
  ensure => present,
}
</pre>
What I want to do here is install the binary and use the a foo resource which 
should pickup the bar provider. Unfortunately I'm not able to apply the catalog
<pre>
# puppet apply --modulepath=/tmp/test -v -d test.pp
debug: Failed to load library 'selinux' for feature 'selinux'
debug: Puppet::Type::Foo::ProviderBar: file /tmp/foobinary does not exist
Could not find a default provider for foo
# ls -l /tmp/foobinary
ls: cannot access /tmp/foobinary: No such file or directory
</pre>

Because I cannot apply the catalog I will never get the binary so all 
subsequent puppet runs will also fail.

The only way to get to my desired state is to first remove all foo types and 
apply the catalog. Then I have the binary on my node and I can put the foo type 
back.

In my opinion there are two solutions:

* install the binary during the first catalog run but let all foo resources 
fail. The foo resources are checked at a second run
* do both in the first run (some kind of lazy provider binding) but then I am 
not able to do a noop run anymore because puppet naturally cant show me what it 
would do with the foo resources if the binary is not yet present.
----------------------------------------
Feature #6907: Ensure providers can be used in the same puppet run that their 
prerequisites are delivered in
https://projects.puppetlabs.com/issues/6907

Author: Nigel Kersten
Status: Accepted
Priority: Urgent
Assignee: 
Category: 
Target version: 2.7.x
Affected Puppet version: 
Keywords: 
Branch: 


This is possibly more accurately described as a collection of bug fixes, as 
we've aimed to fix this several times, however I'm characterizing this as a 
feature, and we're going to associate related bugs with it.

Essentially we want to be able to use a provider in the same run that it's 
prerequisites (like :commands and paths) are delivered in. 

You should not have to run puppet twice to use a provider.

We're aiming this at 2.6.x initially, but if it turns out that we need 
significant plumbing work to make this happen, we are re-targeting at Statler.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to