Issue #5319 has been updated by Nick Moffitt.

Assignee deleted (Nigel Kersten)

Here is a rough draft of my attempts to do this with execs:

<pre>
define select_package() {
        exec { "/usr/bin/dpkg-query -W --showformat '\${Status}' ${name} | grep 
'^install ok installed$'":
                alias => "${name}_installed",
                onlyif => "/bin/echo '${name} install' | /usr/bin/dpkg 
--set-selections",
                require => Exec["select_${name}"],
                subscribe => Exec["select_${name}"],
        "/bin/echo '${name} install' | /usr/bin/dpkg --set-selections":
                alias => "select_${name}",
                unless => "/usr/bin/dpkg-query -W --showformat '\${Status}' 
${name} | grep -e '^\(hold\|install\)'",
        }
}
</pre>

Example usage:

<pre>
select_package{ 'sl': }
file { '/tmp/gubble':
        requires: Exec[sl_installed],
        ...
}
</pre>


It's really ugly and horrible, but it should gracefully handle packages that 
are on hold.
----------------------------------------
Feature #5319: ensure => selected for packages requiring interactive 
installation (dpkg/apt provider at least)
https://projects.puppetlabs.com/issues/5319

Author: Nick Moffitt
Status: Needs design decision
Priority: Normal
Assignee: 
Category: package
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


At times there are packages with catastrophic failure modes when they are run 
noninteractively, particularly when working with dpkg.  As a result I propose 
the following option in package providers, presented from a dpkg standpoint.

If a package resource is ensure => selected, it will have exactly the same 
status behavior as ensure => installed, but the installation process will run 
'echo "${packagename} install" | /usr/bin/dpkg --set-selections'.  This will 
cause the package to be installed the next time an administrator interactively 
runs "apt-get dselect-upgrade".

This allows configuration changes for a particular package to be held back 
until that package is installed interactively.


-- 
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.

Reply via email to