Ah great, then you're happy with the default functions. Andrew J. Millar wrote: > 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 >>
-- Mark Burgess ------------------------------------------------- Professor of Network and System Administration Oslo University College, Norway Personal Web: http://www.iu.hio.no/~mark Office Telf : +47 22453272 ------------------------------------------------- _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine