Issue #2406 has been updated by Patrick Ringl.
Hi there,
since meanwhile we have 'install_options' why don't we use it for this? I'd in
general strongly suggest not to overload 'ensure' with anything but the basic
functionality it is currently (sorta globally) used for.
This has a simple reason: even within a divergent target release, i.e.:
package {$module::package:
ensure => 'VERSION',
provider => 'apt',
install_options => { '-t' => 'your_favourite_repo_target_release' },
}
one can vary the package version. Yes it is uncommon having more than one
version of the same package in the same repo, but yet it is not impossible and
I am pretty sure I am not the only one that came across such a setup.
Overloading the ensure parameter for somewhat similar takes this possibility
away plus it'd restrict the functionality that install_options offers us.
What do you think?
regards,
Patrick
<pre><code class="diff">
diff --git a/lib/puppet/provider/package/apt.rb
b/lib/puppet/provider/package/apt.rb
index 74b261a..670930f 100755
--- a/lib/puppet/provider/package/apt.rb
+++ b/lib/puppet/provider/package/apt.rb
@@ -5,6 +5,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg,
:source => :dpkg do
desc "Package management via `apt-get`."
has_feature :versionable
+ has_feature :install_options
commands :aptget => "/usr/bin/apt-get"
commands :aptcache => "/usr/bin/apt-cache"
@@ -48,6 +49,13 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg,
:source => :dpkg do
checkforcdrom
cmd = %w{-q -y}
+ properties_for_command = nil
+ if resource[:install_options]
+ resource[:install_options].each_pair do |k,v|
+ cmd << [k,v]
+ end
+ end
+
keep = ""
if config = @resource[:configfiles]
if config == :keep
</code></pre>
----------------------------------------
Feature #2406: APT provider's ensure parameter should support release name
https://projects.puppetlabs.com/issues/2406#change-65551
Author: Andrew Pollock
Status: Investigating
Priority: Normal
Assignee: Nigel Kersten
Category: Debian
Target version:
Affected Puppet version: 0.24.8
Keywords:
Branch:
This is a feature request received via Debian, see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513553
>
> I'd like to be able to specify something like:
> package {
> "openoffice.org": ensure => "etch-backports";
> }
>
> This would call:
> apt-get install openoffice.org/etch-backports
> or
> apt-get install -t etch-backports openoffice.org
>
> instead of:
> apt-get install openoffice.org=etch-backports
>
> Can puppet check if the ensure parameter starts with a digit and decide
> accordingly?
>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.