module-apt/manifests/apt_conf.pp
Gabriel Filion ded81d8edc Apply code style corrections from puppet-lint
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
2013-01-02 17:28:59 +01:00

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,
}
}
}