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

  $pref_contents = $apt::custom_preferences ? {
    ''      => $::operatingsystem ? {
      'debian' => template("apt/${::operatingsystem}/preferences_${apt::codename}.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';
  }

}