Issue #7770 has been reported by Adam Gandelman.
----------------------------------------
Bug #7770: warning: Found multiple default providers
https://projects.puppetlabs.com/issues/7770
Author: Adam Gandelman
Status: Unreviewed
Priority: Normal
Assignee: Dan Bode
Category: agent
Target version:
Affected Puppet version: 2.6.4
Keywords:
Branch:
Using a noop provider to work around suitability checks for commands from
yet-to-be installed packages, causes a warning about multiple providers during
runs when the package is actually installed. If the package is not installed
before the run, there are no warnings and the package is later installed.
<pre>
# lib/puppet/type/nova_admin.rb
Puppet::Type.newtype(:nova_admin) do
@doc = "Manage createion/deletion of nova admin users."
ensurable
newparam(:name) do
desc "The name of the admins."
end
end
</pre>
<pre>
# lib/puppet/provider/nova_admin/default.pp
Puppet::Type.type(:nova_admin).provide(:default) do
desc "This is a default provider that does nothing. This allows us to install
nova-manage on the same puppet run where we want to use it."
def create
return false
end
def destroy
return false
end
def exists?
fail('This is just the default provider for nova_admin, all it does is
fail')
end
end
</pre>
<pre>
# lib/puppet/provider/nova_admin/nova_admin.pp
Puppet::Type.type(:nova_admin).provide(:admin) do
desc "Manage nova admin user "
commands :nova_manage => 'nova-manage'
def exists?
nova_manage("user", "list").match(/^#{resource[:name]}$/)
end
def create
nova_manage("user", "admin", resource[:name])
end
def destroy
nova_manage("user", "delete", resource[:name])
end
end
</pre>
<pre>
# admin.pp
class nova::manage::admin ( $username ) {
nova_admin{ $username:
ensure => present,
provider => 'admin',
notify => Exec["nova-db-sync"],
require => Class["nova::db"],
}
}
</pre>
<pre>
warning: Found multiple default providers for nova_admin: admin, default; using
admin
</pre>
--
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.