summaryrefslogtreecommitdiff
path: root/manifests/preferences.pp
blob: 50ca23a93192403ef6493f5b4599a9b103760196 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class apt::preferences {

  $pref_contents = $apt::custom_preferences ? {
    ''      => $::operatingsystem ? {
      'debian' => $::debian_codename ? {
        'lenny' => template("apt/${::operatingsystem}/preferences_lenny.erb"),
        default => template("apt/${::operatingsystem}/preferences.erb"),
      },
      'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"),
    },
    default => $apt::custom_preferences
  }

  file { '/etc/apt/preferences':
    ensure  => present,
    alias   => 'apt_config',
    # only update together
    content => $pref_contents,
    require => File['/etc/apt/sources.list'],
    owner   => root, group => 0, mode => '0644';
  }

}