add refactored files
This commit is contained in:
parent
87d2fe06d1
commit
b0e0f720d0
5 changed files with 73 additions and 0 deletions
16
manifests/default_preferences.pp
Normal file
16
manifests/default_preferences.pp
Normal file
|
@ -0,0 +1,16 @@
|
|||
class apt::default_preferences {
|
||||
config_file {
|
||||
# this just pins unstable and testing to very low values
|
||||
"/etc/apt/preferences":
|
||||
content => template("apt/preferences.erb"),
|
||||
# use 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"];
|
||||
# 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 => File[apt_config];
|
||||
}
|
||||
}
|
10
manifests/default_sources_list.pp
Normal file
10
manifests/default_sources_list.pp
Normal file
|
@ -0,0 +1,10 @@
|
|||
class apt::default_sources_list {
|
||||
config_file {
|
||||
# include main, security and backports
|
||||
# additional sources could be included via an array
|
||||
"/etc/apt/sources.list":
|
||||
content => template("apt/sources.list.erb"),
|
||||
require => Exec[assert_lsbdistcodename];
|
||||
}
|
||||
}
|
||||
|
10
manifests/dselect.pp
Normal file
10
manifests/dselect.pp
Normal file
|
@ -0,0 +1,10 @@
|
|||
class apt::dselect {
|
||||
# suppress annoying help texts of dselect
|
||||
line { dselect_expert:
|
||||
file => "/etc/dpkg/dselect.cfg",
|
||||
line => "expert",
|
||||
ensure => present,
|
||||
}
|
||||
|
||||
package { dselect: ensure => installed }
|
||||
}
|
18
manifests/preseeded_package.pp
Normal file
18
manifests/preseeded_package.pp
Normal file
|
@ -0,0 +1,18 @@
|
|||
define apt::preseeded_package ($content = "", $ensure = "installed") {
|
||||
$seedfile = "/var/cache/local/preseeding/$name.seeds"
|
||||
$real_content = $content ? {
|
||||
"" => template ( "$debian_version/$name.seeds" ),
|
||||
Default => $content
|
||||
}
|
||||
|
||||
file{ $seedfile:
|
||||
content => $real_content,
|
||||
mode => 0600, owner => root, group => root,
|
||||
}
|
||||
|
||||
package { $name:
|
||||
ensure => $ensure,
|
||||
responsefile => $seedfile,
|
||||
require => File[$seedfile],
|
||||
}
|
||||
}
|
19
manifests/upgrade_package.pp
Normal file
19
manifests/upgrade_package.pp
Normal file
|
@ -0,0 +1,19 @@
|
|||
define apt::upgrade_package ($version = "") {
|
||||
case $version {
|
||||
'': {
|
||||
exec { "aptitude -y install $name":
|
||||
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
||||
}
|
||||
}
|
||||
'latest': {
|
||||
exec { "aptitude -y install $name":
|
||||
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
exec { "aptitude -y install $name=$version":
|
||||
onlyif => [ "grep-status -F Status installed -a -P $name -q", "apt-show-versions -u $name | grep -q upgradeable" ],
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue