So the best practice should be like this; :-)

<snippet>
commands:
   debian|ubuntu.Hr00::
      "/usr/bin/aptitude update";

packages:
   debian|ubuntu::
      "$(packages_to_be_installed)"
         package_policy => "add",
         package_method => aptitude;
<snippet>

body package_method aptitude
{
 <snippet>
 package_add_command => "/usr/bin/aptitude --assume-yes install";
  <snippet>
}

Cheers,
--Nakarin

On Jan 26, 2010, at 3:45 PM, Tim Cutts wrote:

> 
> On 26 Jan 2010, at 2:41 pm, Nakarin Phooripoom wrote:
> 
>> Zypper and yum seem to check and update the latest list of packages every 
>> time it runs before installing any selected packages.
>> 
>> Could we do something like this for Debian/Ubuntu?
>> 
>> package_add_command => "/usr/bin/aptitude update && /usr/bin/aptitude 
>> --assume-yes install";
> 
> That's going to create a lot of unnecessary extra work for the machine to do. 
>  What happens if your promises happen to generate a couple of dozen package 
> installations needed?  You'll spank your web proxy (or worse, the upstream 
> repository) rather unnecessarily hard.  Just have a shellcommand run aptitude 
> update for you once a day.
> 
> Tim
> 
> 
> -- 
> The Wellcome Trust Sanger Institute is operated by Genome ResearchLimited, a 
> charity registered in England with number 1021457 and acompany registered in 
> England with number 2742969, whose registeredoffice is 215 Euston Road, 
> London, NW1 2BE.

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to