Sha256: cc466c7ec43f7b21638968eb456365f788a679f4c4def401fa7edef0b6ab3587

Contents?: true

Size: 1.07 KB

Versions: 7

Compression:

Stored size: 1.07 KB

Contents

# pin.pp
# pin a release in apt, useful for unstable repositories

define apt::pin(
  $ensure     = present,
  $explanation = "${::caller_module_name}: ${name}",
  $order      = '',
  $packages   = '*',
  $priority   = 0,
  $release    = '',
  $origin     = '',
  $originator = '',
  $version    = ''
) {

  include apt::params

  $preferences_d = $apt::params::preferences_d

  if $order != '' and !is_integer($order) {
    fail('Only integers are allowed in the apt::pin order param')
  }

  if $release != '' {
    $pin = "release a=${release}"
  } elsif $origin != '' {
    $pin = "origin \"${origin}\""
  } elsif $originator != '' {
    $pin = "release o=${originator}"
  } elsif $version != '' {
    $pin = "version ${version}"
  } else {
    $pin = "release a=${name}"
  }

  $path = $order ? {
    ''      => "${preferences_d}/${name}.pref",
    default => "${preferences_d}/${order}-${name}.pref",
  }
  file { "${name}.pref":
    ensure  => $ensure,
    path    => $path,
    owner   => root,
    group   => root,
    mode    => '0644',
    content => template('apt/pin.pref.erb'),
  }
}

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
service_kiosk-0.5.6 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.5 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.4 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.3 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.2 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.1 provision/modules/apt/manifests/pin.pp
service_kiosk-0.5.0 provision/modules/apt/manifests/pin.pp