Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-2970

warning: Found multiple default providers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Template:

      Description

      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>

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

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

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

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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              redmine.exporter redmine.exporter
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Zendesk Support