projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
simplify site::aptrepo
[mirror/dsa-puppet.git]
/
modules
/
site
/
manifests
/
aptrepo.pp
diff --git
a/modules/site/manifests/aptrepo.pp
b/modules/site/manifests/aptrepo.pp
index
cea4281
..
ea1b920
100644
(file)
--- a/
modules/site/manifests/aptrepo.pp
+++ b/
modules/site/manifests/aptrepo.pp
@@
-1,4
+1,4
@@
-define site::aptrepo ($key = undef, $keyid = undef, $
template = undef, $config = undef
, $ensure = present) {
+define site::aptrepo ($key = undef, $keyid = undef, $
content = '', $source = ''
, $ensure = present) {
case $ensure {
present: {
case $ensure {
present: {
@@
-31,7
+31,7
@@
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
}
} elsif $keyid {
exec { "apt-key-del-${keyid}":
}
} elsif $keyid {
exec { "apt-key-del-${keyid}":
- command => "apt-key del ${keyid}",
+ command
=> "apt-key del ${keyid}",
}
}
}
}
}
}
@@
-39,18
+39,15
@@
define site::aptrepo ($key = undef, $keyid = undef, $template = undef, $config =
}
if $ensure == present {
}
if $ensure == present {
- if ! ($
config or $template
) {
+ if ! ($
source or $content
) {
fail ( "No configuration found for ${name}" )
}
fail ( "No configuration found for ${name}" )
}
- if ($config and $template) {
- fail ( "Can't specify both config and template for ${name}" )
- }
}
file { "/etc/apt/sources.list.d/${name}.list":
ensure => $ensure,
}
file { "/etc/apt/sources.list.d/${name}.list":
ensure => $ensure,
- content =>
template($template)
,
- source => $
config
,
+ content =>
$content
,
+ source => $
source
,
notify => Exec['apt-get update'],
}
}
notify => Exec['apt-get update'],
}
}