I would recommend that you check if the install is successful and run aptitude update if its not. If a updated package is published since you ran "aptitude update" you will get a 404 on your request for the older version. I think this would be the most elegant thing to do, instead of failing to install the package on every run until the packet database gets updated.
/Andreas > 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 > Help-cfengine@cfengine.org > https://cfengine.org/mailman/listinfo/help-cfengine _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine