Puppet Class: yum::plugin::fastestmirror

Inherits:
::yum::params
Defined in:
manifests/plugin/fastestmirror.pp

Overview

Manage the Yum fastestmirror plugin.

Examples:

Declaring the class

include ::yum
include ::yum::plugin::fastestmirror

Parameters:

  • ensure (Enum['present', 'absent']) (defaults to: 'present')
  • enable (Boolean) (defaults to: true)
  • package_name (String) (defaults to: $::yum::params::fastestmirror_package_name)
  • verbose (Optional[Boolean]) (defaults to: false)
  • always_print_best_host (Optional[Boolean]) (defaults to: true)
  • socket_timeout (Optional[Integer[0]]) (defaults to: 3)
  • hostfilepath (Optional[String]) (defaults to: 'timedhosts.txt')
  • maxhostfileage (Optional[Integer[0]]) (defaults to: 10)
  • maxthreads (Optional[Integer[0]]) (defaults to: 15)
  • exclude (Optional[Array[String, 1]]) (defaults to: undef)
  • include_only (Optional[Array[String, 1]]) (defaults to: undef)
  • prefer (Optional[String]) (defaults to: undef)
  • downgrade_ftp (Optional[Boolean]) (defaults to: undef)

See Also:

Since:

  • 1.0.0



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'manifests/plugin/fastestmirror.pp', line 25

class yum::plugin::fastestmirror (
  Enum['present', 'absent']  $ensure                 = 'present',
  Boolean                    $enable                 = true,
  String                     $package_name           = $::yum::params::fastestmirror_package_name,
  Optional[Boolean]          $verbose                = false,
  Optional[Boolean]          $always_print_best_host = true,
  Optional[Integer[0]]       $socket_timeout         = 3,
  Optional[String]           $hostfilepath           = 'timedhosts.txt',
  Optional[Integer[0]]       $maxhostfileage         = 10,
  Optional[Integer[0]]       $maxthreads             = 15,
  Optional[Array[String, 1]] $exclude                = undef,
  Optional[Array[String, 1]] $include_only           = undef,
  Optional[String]           $prefer                 = undef,
  Optional[Boolean]          $downgrade_ftp          = undef,
) inherits ::yum::params {

  if ! defined(Class['::yum']) {
    fail('You must include the yum base class before using the yum::plugin::fastestmirror class')
  }

  package { $package_name:
    ensure => $ensure,
    tag    => [
      "bodgit::${module_name}",
    ],
  }

  if $ensure == 'present' {
    ::yum::plugin { 'fastestmirror':
      content => template("${module_name}/fastestmirror.conf.erb"),
      require => Package[$package_name],
    }
  }
}