summaryrefslogtreecommitdiff
path: root/puppet/modules/apt/manifests/preferences.pp
blob: 6982ca0535cb53c231fa14427cb6fd5e371ed3e7 (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_${::debian_codename}.erb"),
      'ubuntu' => template("apt/${::operatingsystem}/preferences_${::ubuntu_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';
  }

}