abstract the apt preferences so that custom preferences can be set,
while maintaining a sane default preferences set can be set. This is done in the same manner that the custom/default sources_list are handled
This commit is contained in:
parent
e0a6bf1b7a
commit
82e7e762b9
1 changed files with 28 additions and 14 deletions
|
@ -41,6 +41,19 @@ class apt {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case $custom_preferences {
|
||||||
|
'': {
|
||||||
|
include default_preferences
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
config_file { "/etc/apt/preferences":
|
||||||
|
content => $custom_preferences
|
||||||
|
alias => apt_config,
|
||||||
|
require => File["/etc/apt/sources.list"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class default_preferences {
|
||||||
config_file {
|
config_file {
|
||||||
# this just pins unstable and testing to very low values
|
# this just pins unstable and testing to very low values
|
||||||
"/etc/apt/preferences":
|
"/etc/apt/preferences":
|
||||||
|
@ -55,6 +68,7 @@ class apt {
|
||||||
content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
|
content => "APT::Get::Show-Upgraded true;\nDSelect::Clean $real_apt_clean;\n",
|
||||||
before => File[apt_config];
|
before => File[apt_config];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$apt_base_dir = "/var/lib/puppet/modules/apt"
|
$apt_base_dir = "/var/lib/puppet/modules/apt"
|
||||||
modules_dir { apt: }
|
modules_dir { apt: }
|
||||||
|
|
Loading…
Reference in a new issue