params.pp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. case $::lsbdistid {
  8. 'ubuntu', 'debian': {
  9. $distid = $::lsbdistid
  10. $distcodename = $::lsbdistcodename
  11. }
  12. 'linuxmint': {
  13. if $::lsbdistcodename == 'debian' {
  14. $distid = 'debian'
  15. $distcodename = 'wheezy'
  16. } else {
  17. $distid = 'ubuntu'
  18. $distcodename = $::lsbdistcodename ? {
  19. 'qiana' => 'trusty',
  20. 'petra' => 'saucy',
  21. 'olivia' => 'raring',
  22. 'nadia' => 'quantal',
  23. 'maya' => 'precise',
  24. }
  25. }
  26. }
  27. '': {
  28. fail('Unable to determine lsbdistid, is lsb-release installed?')
  29. }
  30. default: {
  31. fail("Unsupported lsbdistid (${::lsbdistid})")
  32. }
  33. }
  34. case $distid {
  35. 'debian': {
  36. case $distcodename {
  37. 'squeeze': {
  38. $backports_location = 'http://backports.debian.org/debian-backports'
  39. $legacy_origin = true
  40. $origins = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables
  41. '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
  42. '${distro_id} ${distro_codename}-lts'] #lint:ignore:single_quote_string_with_variables
  43. }
  44. 'wheezy': {
  45. $backports_location = 'http://ftp.debian.org/debian/'
  46. $legacy_origin = false
  47. $origins = ['origin=Debian,archive=stable,label=Debian-Security',
  48. 'origin=Debian,archive=oldstable,label=Debian-Security']
  49. }
  50. default: {
  51. $backports_location = 'http://http.debian.net/debian/'
  52. $legacy_origin = false
  53. $origins = ['origin=Debian,archive=stable,label=Debian-Security']
  54. }
  55. }
  56. }
  57. 'ubuntu': {
  58. case $distcodename {
  59. 'lucid': {
  60. $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
  61. $ppa_options = undef
  62. $legacy_origin = true
  63. $origins = ['${distro_id} ${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  64. }
  65. 'precise', 'trusty', 'utopic', 'vivid': {
  66. $backports_location = 'http://us.archive.ubuntu.com/ubuntu'
  67. $ppa_options = '-y'
  68. $legacy_origin = true
  69. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  70. }
  71. default: {
  72. $backports_location = 'http://old-releases.ubuntu.com/ubuntu'
  73. $ppa_options = '-y'
  74. $legacy_origin = true
  75. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  76. }
  77. }
  78. }
  79. }
  80. }