2011-05-30 19:18:13 +02:00
|
|
|
class apt::params {
|
2012-02-24 23:03:51 +01:00
|
|
|
$root = '/etc/apt'
|
|
|
|
$provider = '/usr/bin/apt-get'
|
2015-02-20 00:09:44 +01:00
|
|
|
$sources_list = "${root}/sources.list"
|
2012-02-24 23:03:51 +01:00
|
|
|
$sources_list_d = "${root}/sources.list.d"
|
2015-02-20 00:09:44 +01:00
|
|
|
$conf_d = "${root}/apt.conf.d"
|
|
|
|
$preferences = "${root}/preferences"
|
2012-04-11 23:54:13 +02:00
|
|
|
$preferences_d = "${root}/preferences.d"
|
|
|
|
|
2015-02-15 18:39:17 +01:00
|
|
|
if $::osfamily != 'Debian' {
|
|
|
|
fail('This module only works on Debian or derivatives like Ubuntu')
|
|
|
|
}
|
|
|
|
|
2012-05-03 18:51:14 +02:00
|
|
|
case $::lsbdistid {
|
2014-08-29 16:23:21 +02:00
|
|
|
'ubuntu', 'debian': {
|
|
|
|
$distid = $::lsbdistid
|
|
|
|
$distcodename = $::lsbdistcodename
|
|
|
|
}
|
2014-08-29 16:57:09 +02:00
|
|
|
'linuxmint': {
|
|
|
|
if $::lsbdistcodename == 'debian' {
|
|
|
|
$distid = 'debian'
|
|
|
|
$distcodename = 'wheezy'
|
|
|
|
} else {
|
|
|
|
$distid = 'ubuntu'
|
|
|
|
$distcodename = $::lsbdistcodename ? {
|
|
|
|
'qiana' => 'trusty',
|
|
|
|
'petra' => 'saucy',
|
|
|
|
'olivia' => 'raring',
|
|
|
|
'nadia' => 'quantal',
|
|
|
|
'maya' => 'precise',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-08-29 16:23:21 +02:00
|
|
|
'': {
|
|
|
|
fail('Unable to determine lsbdistid, is lsb-release installed?')
|
|
|
|
}
|
|
|
|
default: {
|
|
|
|
fail("Unsupported lsbdistid (${::lsbdistid})")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case $distid {
|
2012-04-11 23:54:13 +02:00
|
|
|
'ubuntu': {
|
2014-08-29 16:23:21 +02:00
|
|
|
case $distcodename {
|
2014-03-27 13:51:08 +01:00
|
|
|
'lucid': {
|
|
|
|
$ppa_options = undef
|
2014-02-21 01:43:48 +01:00
|
|
|
}
|
2014-12-11 05:22:48 +01:00
|
|
|
'precise', 'trusty', 'utopic', 'vivid': {
|
2014-03-27 13:51:08 +01:00
|
|
|
$ppa_options = '-y'
|
2012-04-11 23:54:13 +02:00
|
|
|
}
|
|
|
|
default: {
|
2014-03-27 13:51:08 +01:00
|
|
|
$ppa_options = '-y'
|
2012-04-11 23:54:13 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-05-30 19:18:13 +02:00
|
|
|
}
|