params.pp 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. $legacy_origin = true
  42. $origins = ['${distro_id} oldstable', #lint:ignore:single_quote_string_with_variables
  43. '${distro_id} ${distro_codename}-security', #lint:ignore:single_quote_string_with_variables
  44. '${distro_id} ${distro_codename}-lts'] #lint:ignore:single_quote_string_with_variables
  45. }
  46. 'wheezy': {
  47. $legacy_origin = false
  48. $origins = ['origin=Debian,archive=stable,label=Debian-Security',
  49. 'origin=Debian,archive=oldstable,label=Debian-Security']
  50. }
  51. default: {
  52. $legacy_origin = false
  53. $origins = ['origin=Debian,archive=stable,label=Debian-Security']
  54. }
  55. }
  56. }
  57. 'ubuntu': {
  58. case $distcodename {
  59. 'lucid': {
  60. $ppa_options = undef
  61. $legacy_origin = true
  62. $origins = ['${distro_id} ${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  63. }
  64. 'precise', 'trusty', 'utopic', 'vivid': {
  65. $ppa_options = '-y'
  66. $legacy_origin = true
  67. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  68. }
  69. default: {
  70. $ppa_options = '-y'
  71. $legacy_origin = true
  72. $origins = ['${distro_id}:${distro_codename}-security'] #lint:ignore:single_quote_string_with_variables
  73. }
  74. }
  75. }
  76. }
  77. }