Ah, Many thanks Nakarin! That has done the trick! :-D

I'm using a similar recipe for managing users - I've found canonify to
be my friend.  Once I've got it working they way I want I'll post it in
case it helps others.

On Thu, Feb 04, 2010 at 01:08:53PM +0100, Nakarin Phooripoom wrote:
> Why don't you use packages: stanza instead? Cfengine will check a status of 
> all those packages behind the scene. A body package_method yum could be found 
> in cfengine_stdlib.cf
> 
> body common control
> {
> bundlesequence => { "checkrpms" };
> }
> 
> #############################################
> 
> bundle agent checkrpms
> {
> vars:
> 
>  "rpms_needed" slist => {  "rpm-build", "createrepo"  },
>        comment => "List of required RPMs";
> 
> packages:
> 
>   "$(rpms_needed)"
> 
>      package_policy => "add",
>      package_method => yum;
> 
> }
> #############################################
> 
> body package_method yum
> 
> {
> any::
> 
>  package_changes => "bulk";
> 
>  # Could use rpm for this
>  package_list_command => "/usr/bin/yum list installed";
> 
>  # Remember to escape special characters like |
> 
>  package_list_name_regex    => "([^.]+).*";
>  package_list_version_regex => "[^\s]\s+([^\s]+).*";
>  package_list_arch_regex    => "[^.]+\.([^\s]+).*";
> 
>  package_installed_regex => ".*installed.*";
> 
>  package_name_convention => "$(name).$(arch)";
> 
>  package_add_command => "/usr/bin/yum -q -y install";
>  package_delete_command => "/bin/rpm -e --nodeps";
>  package_verify_command => "/bin/rpm -V";
> }
> 
> Cheers,
> --Nakarin
> 
-- 
        Quid, me anxius sum?

Andrew Millar
Senior *NIX Administrator

NET-A-PORTER.COM
The Dome
Whiteleys Centre
151 Queensway
London, W2 4YN

+44 (0)207 198 4669


Shop spring’s building blocks at NET-A-PORTER.COM
______________________________________________________________________

CONFIDENTIALITY NOTICE
The information in this email is confidential and is intended solely for the 
addressee. Access to this email by anyone else is unauthorised. If you are not 
the intended recipient, you must not read, use or disseminate the information. 
Any views expressed in this message are those of the individual sender, except 
where the sender specifically states them to be the views of Net a Porter Ltd. 

Net A Porter Ltd is a company registered in England & Wales Number: 3820604 
Registered Office: The Dome, Whiteleys Centre, 151 Queensway, London, W2 4YN.
_____________________________________________________________________
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to