aboutsummaryrefslogtreecommitdiff
path: root/manifests/preferences.pp
blob: 232b8f70c16711c65d9885e7a0b4355f2efa0fd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class apt::preferences {

  include common::moduledir
  $apt_preferences_dir = "${common::moduledir::module_dir_path}/apt/preferences"
  module_dir{'apt/preferences': }
  file{"${apt_preferences_dir}_header":
    content => 'Package: *
Pin: release a=unstable
Pin-Priority: 1

Package: *
Pin: release a=testing
Pin-Priority: 2

',
  }

  concatenated_file{'/etc/apt/preferences':
    dir => $apt_preferences_dir,
    header => "${apt_preferences_dir}_header",
    # use Concatenated_file[apt_config] to reference a completed configuration
    # See "The Puppet Semaphor" 2007-06-25 on the puppet-users ML
    alias => apt_config,
    # only update together
    require => File["/etc/apt/sources.list"];
  }

  config_file {
    # little default settings which keep the system sane
    "/etc/apt/apt.conf.d/from_puppet":
      content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
      before => Concatenated_file[apt_config];
  }
}