class apt::params {
- if $caller_module_name and $caller_module_name != $module_name {
- fail('apt::params is a private class and cannot be accessed directly')
+ if $::osfamily != 'Debian' {
+ fail('This module only works on Debian or derivatives like Ubuntu')
}
$root = '/etc/apt'
$preferences = "${root}/preferences"
$preferences_d = "${root}/preferences.d"
$keyserver = 'keyserver.ubuntu.com'
-
- if $::osfamily != 'Debian' {
- fail('This module only works on Debian or derivatives like Ubuntu')
- }
+ $confs = {}
+ $update = {}
+ $purge = {}
+ $proxy = {}
+ $sources = {}
+ $keys = {}
+ $ppas = {}
+ $pins = {}
+ $settings = {}
$config_files = {
'conf' => {
},
'pref' => {
'path' => $preferences_d,
- 'ext' => '',
+ 'ext' => '.pref',
},
'list' => {
'path' => $sources_list_d,
}
$update_defaults = {
- 'always' => false,
'frequency' => 'reluctantly',
+ 'loglevel' => undef,
'timeout' => undef,
'tries' => undef,
}
$proxy_defaults = {
- 'host' => undef,
- 'port' => 8080,
- 'https' => false,
+ 'ensure' => undef,
+ 'host' => undef,
+ 'port' => 8080,
+ 'https' => false,
}
$purge_defaults = {
- 'sources.list' => true,
- 'sources.list.d' => true,
- 'preferences' => true,
- 'preferences.d' => true,
+ 'sources.list' => false,
+ 'sources.list.d' => false,
+ 'preferences' => false,
+ 'preferences.d' => false,
}
$source_key_defaults = {
'source' => undef,
}
- $file_defaults = {
- 'owner' => 'root',
- 'group' => 'root',
- 'mode' => '0644',
+ $include_defaults = {
+ 'deb' => true,
+ 'src' => false,
}
- case $::lsbdistid {
- 'ubuntu', 'debian': {
- $distid = $::lsbdistid
- $distcodename = $::lsbdistcodename
- }
- 'linuxmint': {
- if $::lsbdistcodename == 'debian' {
- $distid = 'debian'
- $distcodename = 'wheezy'
- } else {
- $distid = 'ubuntu'
- $distcodename = $::lsbdistcodename ? {
- 'qiana' => 'trusty',
- 'petra' => 'saucy',
- 'olivia' => 'raring',
- 'nadia' => 'quantal',
- 'maya' => 'precise',
+ case $facts['os']['name']{
+ 'Debian': {
+ case $facts['os']['release']['full'] {
+ '6.0': {
+ $backports = {
+ 'location' => 'http://httpredir.debian.org/debian-backports',
+ 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
+ 'repos' => 'main contrib non-free',
+ }
+ }
+ default: {
+ $backports = {
+ 'location' => 'http://httpredir.debian.org/debian',
+ 'key' => 'A1BD8E9D78F7FE5C3E65D8AF8B48AD6246925553',
+ 'repos' => 'main contrib non-free',
+ }
}
}
+
+ $ppa_options = undef
+ $ppa_package = undef
+
}
- '': {
- fail('Unable to determine lsbdistid, is lsb-release installed?')
- }
- default: {
- fail("Unsupported lsbdistid (${::lsbdistid})")
- }
- }
- case $distid {
- 'ubuntu': {
- case $distcodename {
- 'lucid': {
+ 'Ubuntu': {
+ $backports = {
+ 'location' => 'http://archive.ubuntu.com/ubuntu',
+ 'key' => '630239CC130E1A7FD81A27B140976EAF437D05B5',
+ 'repos' => 'main universe multiverse restricted',
+ }
+
+ case $facts['os']['release']['full'] {
+ '10.04': {
$ppa_options = undef
$ppa_package = 'python-software-properties'
}
- 'precise': {
+ '12.04': {
$ppa_options = '-y'
$ppa_package = 'python-software-properties'
}
- 'trusty', 'utopic', 'vivid': {
+ '14.04', '14.10', '15.04', '15.10': {
$ppa_options = '-y'
$ppa_package = 'software-properties-common'
}
default: {
$ppa_options = '-y'
- $ppa_package = 'software-properties-common'
+ $ppa_package = 'python-software-properties'
}
}
}
+ undef: {
+ fail('Unable to determine value for fact os["name"]')
+ }
+ default: {
+ $ppa_options = undef
+ $ppa_package = undef
+ $backports = undef
+ }
}
}