Jessica,

  I just test your example on a rpm based (Centos) yum installation and had 
problems with your body package_method yum_rpm_exact. Is does not extract 
the version of the package, eg: rpm -q apr
{{{
apr-1.2.7-11.el5_6.4
}}}

Your version display this as:
package: apr
version: 1.2.7

and refuses to install/update the package


I used this example and everything worked as expected, not the i386 version 
was ok so that is why i had to specify package_architecture, eg

I am using the yum_rpm from the 'cfengine_stdlib.cf' your
{{{
bundle agent packagesClient {

packages:

     "apr"
       package_policy  => "addupdate",
       package_version => "1.2.7-11.el5_6.5",
       package_method  => yum_rpm,
       package_architectures => { "x86_64" },
       package_select  => ">=";

}
}}}

On 30-06-11 21:03, no-re...@cfengine.com wrote:
> Forum: Cfengine Help
> Subject: Re: Advice on using package promises
> Author: jgreer
> Link to topic: https://cfengine.com/forum/read.php?3,22672,22690#msg-22690
>
> That results in syntax errors in r2498.  It appears not to respect 
> 'package_version' as an alternative to passing the version as part of the 
> promiser and drawing it out with 'package_version_regex'?  The error is 
> misleading, too - as though this is the error that should correspond to a 
> missing 'package_list_version_regex' definition.
>
>
>
> bundle agent packagesClient {
>
> packages:
>
>      "wireshark-1.0.15"
>        package_policy  =>  "addupdate",
>        package_method  =>  yum_rpm_exact,
>        package_select  =>  "==",
>        action          =>  actionsettings_fix_inform("inform");
>
> }
>
> body package_method yum_rpm_exact
>
> {
>    package_changes =>  "individual";
>    package_list_command =>  "/bin/rpm -qa --qf '%{name} %{version} 
> %{arch}\n'";
>
>    package_list_name_regex    =>  "^(\S+?)\s\S+?\s\S+$";
>    package_list_version_regex =>  "^\S+?\s(\S+?)\s\S+$";
>    package_list_arch_regex    =>  "^\S+?\s\S+?\s(\S+)$";
>    package_list_update_ifelapsed =>  "1";
>
>
>    package_installed_regex =>  ".*";
>    package_name_convention =>  "$(name)-$(version)";
>
>    package_name_regex =>  ".*";
>
>    package_add_command    =>  "/usr/bin/yum -y install";
>    package_update_command =>  "/usr/bin/yum -y update";
>    package_delete_command =>  "/bin/rpm -e --allmatches";
>    package_verify_command =>  "/bin/rpm -V";
>
> }
>
>
>
>
>
> # cf-agent -K
>   !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of 
> '/var/cfengine/inputs/dcsunix/packagesClient.cf' near line 41
>   !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of 
> '/var/cfengine/inputs/dcsunix/packagesClient.cf' near line 41
>   !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of 
> '/var/cfengine/inputs/dcsunix/packagesClient.cf' near line 41
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine


-- 
********************************************************************
*  Bas van der Vlies                    e-mail: b...@sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to