Sha256: 25a06634c5af7c385b1bd48a611f1b7ce8c39b70b75769045159a38300c15574

Contents?: true

Size: 1.56 KB

Versions: 18

Compression:

Stored size: 1.56 KB

Contents

Puppet::Type.type(:package).provide :dnf, :parent => :yum do
  desc "Support via `dnf`.

  Using this provider's `uninstallable` feature will not remove dependent packages. To
  remove dependent packages with this provider use the `purgeable` feature, but note this
  feature is destructive and should be used with the utmost care.

  This provider supports the `install_options` attribute, which allows command-line flags to be passed to dnf.
  These options should be specified as a string (e.g. '--flag'), a hash (e.g. {'--flag' => 'value'}),
  or an array where each element is either a string or a hash."

  has_feature :install_options, :versionable, :virtual_packages

  commands :cmd => "dnf", :rpm => "rpm"

  # Note: this confine was borrowed from the Yum provider. The
  # original purpose (from way back in 2007) was to make sure we
  # never try to use RPM on a machine without it. We think this
  # has probably become obsolete with the way `commands` work, so
  # we should investigate removing it at some point.
  if command('rpm')
    confine :true => begin
      rpm('--version')
      rescue Puppet::ExecutionFailure
        false
      else
        true
      end
  end

  defaultfor :operatingsystem => :fedora, :operatingsystemmajrelease => ['22', '23', '24', '25', '26']

  def self.update_command
    # In DNF, update is deprecated for upgrade
    'upgrade'
  end

  # The value to pass to DNF as its error output level.
  # DNF differs from Yum slightly with regards to error outputting.
  #
  # @param None
  # @return [String]
  def self.error_level
    '1'
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
bolt-0.17.1 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.17.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.16.4 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.16.3 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.16.2 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.16.1 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.16.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.15.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.14.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.13.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.12.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.11.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.10.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.9.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.8.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.7.0 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.6.1 vendored/puppet/lib/puppet/provider/package/dnf.rb
bolt-0.6.0 vendored/puppet/lib/puppet/provider/package/dnf.rb