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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
class apt::preferences {
file { '/etc/apt/preferences':
ensure => absent;
}
if ($apt::manage_preferences == true) and ($apt::custom_preferences != undef) {
file {
'/etc/apt/preferences.d/custom':
ensure => present,
alias => 'apt_config',
content => template($apt::custom_preferences),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
'/etc/apt/preferences.d/stable':
ensure => absent;
'/etc/apt/preferences.d/volatile':
ensure => absent;
'/etc/apt/preferences.d/lts':
ensure => absent;
'/etc/apt/preferences.d/nextcodename':
ensure => absent;
}
}
elsif $apt::manage_preferences == true {
if $::operatingsystem == "Debian" {
file {
'/etc/apt/preferences.d/stable':
ensure => present,
alias => 'apt_config',
content => template('apt/Debian/stable.erb'),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
'/etc/apt/preferences.d/custom':
ensure => absent;
}
if $apt::use_volatile {
file { '/etc/apt/preferences.d/volatile':
ensure => present,
content => template('apt/Debian/volatile.erb'),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
}
}
if $apt::use_lts {
file { '/etc/apt/preferences.d/lts':
ensure => present,
content => template('apt/Debian/lts.erb'),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
}
}
if ($::debian_nextcodename) and ($::debian_nextcodename != "experimental") {
file { '/etc/apt/preferences.d/nextcodename':
ensure => present,
content => template('apt/Debian/nextcodename.erb'),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
}
}
}
elsif $::operatingsystem == "Ubuntu" {
file { '/etc/apt/preferences':
ensure => present,
alias => 'apt_config',
# only update together
content => template("apt/Ubuntu/preferences_${apt::codename}.erb"),
require => File['/etc/apt/sources.list'],
owner => root, group => 0, mode => '0644';
}
}
}
elsif $apt::manage_preferences == false {
file {
'/etc/apt/preferences.d/custom':
ensure => absent;
'/etc/apt/preferences.d/stable':
ensure => absent;
'/etc/apt/preferences.d/volatile':
ensure => absent;
'/etc/apt/preferences.d/lts':
ensure => absent;
'/etc/apt/preferences.d/nextcodename':
ensure => absent;
}
}
}
|