backports.pp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # This adds the necessary components to get backports for ubuntu and debian
  2. #
  3. # == Parameters
  4. #
  5. # [*release*]
  6. # The ubuntu/debian release name. Defaults to $lsbdistcodename. Setting this
  7. # manually can cause undefined behavior. (Read: universe exploding)
  8. #
  9. # == Examples
  10. #
  11. # include apt::backports
  12. #
  13. # class { 'apt::backports':
  14. # release => 'natty',
  15. # }
  16. #
  17. # == Authors
  18. #
  19. # Ben Hughes, I think. At least blame him if this goes wrong.
  20. # I just added puppet doc.
  21. #
  22. # == Copyright
  23. #
  24. # Copyright 2011 Puppet Labs Inc, unless otherwise noted.
  25. class apt::backports(
  26. $release = $::lsbdistcodename,
  27. $location = $apt::params::backports_location
  28. ) inherits apt::params {
  29. $release_real = downcase($release)
  30. $key = $::lsbdistid ? {
  31. 'debian' => '55BE302B',
  32. 'ubuntu' => '437D05B5',
  33. }
  34. $repos = $::lsbdistid ? {
  35. 'debian' => 'main contrib non-free',
  36. 'ubuntu' => 'main universe multiverse restricted',
  37. }
  38. apt::source { 'backports':
  39. location => $location,
  40. release => "${release_real}-backports",
  41. repos => $repos,
  42. key => $key,
  43. key_server => 'pgp.mit.edu',
  44. pin => '200',
  45. }
  46. }