- lsb-release installed
- the common module: git://labs.riseup.net/shared-common
+- the concat module: https://github.com/ripienaar/puppet-concat
By default, on normal hosts, this module sets the configuration option
DSelect::Clean to 'auto'. On virtual servers, the value is set by default to
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":
+ concat::fragment{"apt_preferences_header":
content => $custom_preferences ? {
'' => $operatingsystem ? {
'debian' => template("apt/${operatingsystem}/preferences_${codename}.erb"),
},
default => $custom_preferences
},
+ order => 00,
+ target => '/etc/apt/preferences',
}
- 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
+ concat{'/etc/apt/preferences':
alias => apt_config,
# only update together
- require => File["/etc/apt/sources.list"];
+ require => File["/etc/apt/sources.list"],
+ owner => root, group => 0, mode => 0644;
}
}
include apt::preferences
- file { "${apt::preferences::apt_preferences_dir}/${name}":
+ concat::fragment{"apt_preference_${name}":
ensure => $ensure,
- #TODO this template is somewhat limited
- notify => Exec["concat_${apt::preferences::apt_preferences_dir}"],
- owner => root, group => 0, mode => 0600;
+ target => '/etc/apt/preferences',
}
# This should really work in the same manner as sources_list and apt_conf
# lenny, we can't generalize without going into ugly special-casing.
case $source {
'': {
- File["${apt::preferences::apt_preferences_dir}/${name}"] {
+ Concat::Fragment[$name]{
content => template("apt/preferences_snippet.erb")
}
}
default: {
- File["${apt::preferences::apt_preferences_dir}/${name}"] {
+ Concat::Fragment[$name]{
source => $source
}
}