params.pp 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. class apt::params {
  2. $root = '/etc/apt'
  3. $provider = '/usr/bin/apt-get'
  4. $sources_list_d = "${root}/sources.list.d"
  5. $apt_conf_d = "${root}/apt.conf.d"
  6. $preferences_d = "${root}/preferences.d"
  7. if $::osfamily != 'Debian' {
  8. fail('This module only works on Debian or derivatives like Ubuntu')
  9. }
  10. case $::lsbdistid {
  11. 'ubuntu', 'debian': {
  12. $distid = $::lsbdistid
  13. $distcodename = $::lsbdistcodename
  14. }
  15. 'linuxmint': {
  16. if $::lsbdistcodename == 'debian' {
  17. $distid = 'debian'
  18. $distcodename = 'wheezy'
  19. } else {
  20. $distid = 'ubuntu'
  21. $distcodename = $::lsbdistcodename ? {
  22. 'qiana' => 'trusty',
  23. 'petra' => 'saucy',
  24. 'olivia' => 'raring',
  25. 'nadia' => 'quantal',
  26. 'maya' => 'precise',
  27. }
  28. }
  29. }
  30. '': {
  31. fail('Unable to determine lsbdistid, is lsb-release installed?')
  32. }
  33. default: {
  34. fail("Unsupported lsbdistid (${::lsbdistid})")
  35. }
  36. }
  37. case $distid {
  38. 'debian': {
  39. case $distcodename {
  40. 'squeeze': {
  41. $backports_location = 'http://backports.debian.org/debian-backports'
  42. $legacy_origin = true
  43. $origins = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables
  44. '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
  45. '${distro_id} ${distro_codename}-lts'] #lint:ignore:single_quote_string_with_variables
  46. }
  47. 'wheezy': {
  48. $backports_location = 'http://ftp.debian.org/debian/'
  49. $legacy_origin = false
  50. $origins = ['origin=Debian,archive=stable,label=Debian-Security',
  51. 'origin=Debian,archive=oldstable,label=Debian-Security']
  52. }
  53. default: {
  54. $backports_location = 'http://http.debian.net/debian/'
  55. $legacy_origin = false
  56. $origins = ['origin=Debian,archive=stable,label=Debian-Security']
  57. }
  58. }
  59. }
  60. 'ubuntu': {
  61. case $distcodename {
  62. 'lucid': {
  63. $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
  64. $ppa_options = undef
  65. $legacy_origin = true
  66. $origins = ['${distro_id} ${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  67. }
  68. 'precise', 'trusty', 'utopic', 'vivid': {
  69. $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
  70. $ppa_options = '-y'
  71. $legacy_origin = true
  72. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  73. }
  74. default: {
  75. $backports_location = 'http://old-releases.ubuntu.com/ubuntu'
  76. $ppa_options = '-y'
  77. $legacy_origin = true
  78. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  79. }
  80. }
  81. }
  82. }
  83. }