Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
(#14308) Add ensure=>absent for define resource.
[puppet-modules/puppetlabs-apt.git]
/
manifests
/
force.pp
diff --git
a/manifests/force.pp
b/manifests/force.pp
index ec6f57e2ccdb540bf4c1cad82edc115beb863861..0089bbd75393d02044e62427a7470a0528405b31 100644
(file)
--- a/
manifests/force.pp
+++ b/
manifests/force.pp
@@
-7,15
+7,15
@@
define apt::force(
) {
$version_string = $version ? {
) {
$version_string = $version ? {
- false => undef,
+ false
=> undef,
default => "=${version}",
}
default => "=${version}",
}
+ $install_check = $version ? {
+ false => "/usr/bin/dpkg -s ${name} | grep -q 'Status: install'",
+ default => "/usr/bin/dpkg -s ${name} | grep -q 'Version: ${version}'",
+ }
exec { "/usr/bin/aptitude -y -t ${release} install ${name}${version_string}":
exec { "/usr/bin/aptitude -y -t ${release} install ${name}${version_string}":
- unless => $version ? {
- false => "/usr/bin/dpkg -s ${name} | grep -q 'Status: install'",
- default => "/usr/bin/dpkg -s ${name} | grep -q 'Version: ${version}'"
- }
+ unless => $install_check,
}
}
-
}
}