Merge commit 'ac76a5d52df78aec919f08334ca5b140902a9298'

(Starting to merge changes from immerda.)

Conflicts:
	manifests/default_sources_list.pp
	manifests/init.pp
This commit is contained in:
intrigeri 2010-11-21 16:24:57 +01:00
commit ee6d13d1e4
8 changed files with 66 additions and 41 deletions

1
files/02show_upgraded Normal file
View file

@ -0,0 +1 @@
APT::Get::Show-Upgraded true;

1
files/03clean Normal file
View file

@ -0,0 +1 @@
DSelect::Clean auto;

View file

@ -0,0 +1,29 @@
define apt::apt_conf_snippet(
$ensure = 'present',
$source = '',
$content = undef
){
if $source == '' and $content == undef {
fail("One of \$source or \$content must be specified for apt_conf_snippet ${name}")
}
if $source != '' and $content != undef {
fail("Only one of \$source or \$content must specified for apt_conf_snippet ${name}")
}
if $source {
file { "/etc/apt/apt.conf.d/${name}":
ensure => $ensure,
source => $source,
notify => Exec["refresh_apt"],
owner => root, group => 0, mode => 0600;
}
}
else {
file { "/etc/apt/apt.conf.d/${name}":
ensure => $ensure,
content => $content,
notify => Exec["refresh_apt"],
owner => root, group => 0, mode => 0600;
}
}
}

View file

@ -1,10 +0,0 @@
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/${operatingsystem}/sources.list.erb"),
require => Package['lsb'];
}
}

View file

@ -68,10 +68,11 @@ class apt {
require => undef,
}
include lsb
# init $release, $next_release, $codename, $next_codename
case $lsbdistcodename {
'': {
include lsb
$codename = $lsbdistcodename
$release = $lsbdistrelease
}
@ -85,7 +86,14 @@ class apt {
case $custom_sources_list {
'': {
include apt::default_sources_list
config_file {
# include main, security and backports
# additional sources should be included via the custom_sources_template
# define
"/etc/apt/sources.list":
content => template( "apt/$operatingsystem/sources.list.erb"),
require => Package['lsb'];
}
}
default: {
config_file { "/etc/apt/sources.list":
@ -94,6 +102,18 @@ class apt {
}
}
apt_conf_snippet{ "02show_upgraded":
source => ["puppet:///modules/site-apt/${fqdn}/02show_upgraded",
"puppet:///modules/site-apt/02show_upgraded",
"puppet:///modules/apt/02show_upgraded"]
}
apt_conf_snippet{ "03clean":
source => ["puppet:///modules/site-apt/${fqdn}/03clean",
"puppet:///modules/site-apt/03clean",
"puppet:///modules/apt/03clean"]
}
case $custom_preferences {
false: {
include apt::preferences::absent
@ -103,26 +123,14 @@ class apt {
}
}
config_file { '/etc/apt/apt.conf.d/99from_puppet': }
# little default settings which keep the system sane
append_if_no_such_line { 'apt-get-show-upgraded':
file => "/etc/apt/apt.conf.d/99from_puppet",
line => "APT::Get::Show-Upgraded true;",
before => Concatenated_file['/etc/apt/preferences'],
require => Config_file['/etc/apt/apt.conf.d/99from_puppet'],
}
append_if_no_such_line { 'dselect-clean':
file => "/etc/apt/apt.conf.d/99from_puppet",
line => "DSelect::Clean ${real_apt_clean};",
before => Concatenated_file['/etc/apt/preferences'],
require => Config_file['/etc/apt/apt.conf.d/99from_puppet'],
}
# backward compatibility: upgrade from previous versions of this module.
file {
"/etc/apt/apt.conf.d/from_puppet":
["/etc/apt/apt.conf.d/from_puppet",
"/etc/apt/apt.conf.d/99from_puppet"
]:
ensure => 'absent',
require => [ Append_if_no_such_line['apt-get-show-upgraded'],
Append_if_no_such_line['dselect-clean']
require => [ Apt_conf_snippet['02show_upgraded'],
Apt_conf_snippet['03clean'],
],
}

View file

@ -10,9 +10,7 @@ class apt::proxy-client {
default => $apt_proxy_port
}
file { "/etc/apt/apt.conf.d/20proxy":
ensure => present,
content => "Acquire::http { Proxy \"http://$real_apt_proxy:$real_apt_proxy_port\"; };\n",
owner => root, group => 0, mode => 0644;
apt_conf_snippet { "20proxy":
content => template("apt/20proxy.erb"),
}
}

View file

@ -4,14 +4,11 @@ class apt::unattended_upgrades {
require => undef,
}
config_file {
"/etc/apt/apt.conf.d/50unattended-upgrades":
apt_conf_snippet { "50unattended-upgrades":
source => ["puppet:///modules/site-apt/50unattended-upgrades",
"puppet:///modules/apt/50unattended-upgrades" ],
# err: Could not run Puppet configuration client: Could not find dependent Config_file[apt_config] for Config_file[/etc/apt/apt.conf.d/50unattended-upgrades] at /etc/puppet/modules/apt/manifests/unattended_upgrades.pp:14
#before => Config_file[apt_config],
before => Concatenated_file[apt_config],
require => Package['unattended-upgrades'],
}
}

1
templates/20proxy.erb Normal file
View file

@ -0,0 +1 @@
Acquire::http { Proxy "http://<%= real_apt_proxy %>:<%= real_apt_proxy_port %>"; };