ded81d8edc
Signed-off-by: Gabriel Filion <lelutin@gmail.com> + more linting by intrigeri. Conflicts: manifests/apticron.pp manifests/cron/dist_upgrade.pp manifests/cron/download.pp manifests/dist_upgrade/initiator.pp manifests/init.pp manifests/listchanges.pp manifests/preferences.pp manifests/preseeded_package.pp manifests/proxy_client.pp manifests/unattended_upgrades.pp manifests/update.pp
38 lines
895 B
Puppet
38 lines
895 B
Puppet
define apt::apt_conf(
|
|
$ensure = 'present',
|
|
$source = '',
|
|
$content = undef )
|
|
{
|
|
|
|
if $source == '' and $content == undef {
|
|
fail("One of \$source or \$content must be specified for apt_conf ${name}")
|
|
}
|
|
|
|
if $source != '' and $content != undef {
|
|
fail("Only one of \$source or \$content must specified for apt_conf ${name}")
|
|
}
|
|
|
|
include apt::dot_d_directories
|
|
|
|
# One would expect the 'file' resource on sources.list.d to trigger an
|
|
# apt-get update when files are added or modified in the directory, but it
|
|
# apparently doesn't.
|
|
file { "/etc/apt/apt.conf.d/${name}":
|
|
ensure => $ensure,
|
|
owner => root,
|
|
group => 0,
|
|
mode => '0644',
|
|
notify => Exec['refresh_apt'],
|
|
}
|
|
|
|
if $source {
|
|
File["/etc/apt/apt.conf.d/${name}"] {
|
|
source => $source,
|
|
}
|
|
}
|
|
else {
|
|
File["/etc/apt/apt.conf.d/${name}"] {
|
|
content => $content,
|
|
}
|
|
}
|
|
}
|