Hi Mathew,
The package_method is not a string, but a reference to a body, so you
mustn't quote it if you want to make it work
Regards,
Nicolas
On 13/09/2010 01:00, Mathew Hennessy wrote:
> Hi,
> When trying to get the following to work (excerpt):
>
> bundle action foobar
> {
> vars:
> redhat.tomcat_host::
> "add_package" slist => {"httpd"};
> "upd_package" slist => {"httpd"};
> "del_package" slist => {"unnecessary-pkg"};
>
> packages:
> redhat::
> "$(add_package)"
> comment => "add packages ($(add_package))",
> package_method => "yum",
> package_policy => "add";
>
> "$(upd_package)"
> comment => "upd packages ($(upd_package))",
> package_method => "yum",
> package_policy => "update";
>
> "$(del_package)"
> comment => "del packages ($(del_package))",
> package_method => "yum",
> package_policy => "delete";
> }
>
> I get the following errors on an eligible client:
>
> # cf-agent
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 148
> I: Comment: add packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 153
> I: Comment: upd packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 158
> I: Comment: del packages (unnecessary-pkg)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 148
> I: Comment: add packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 153
> I: Comment: upd packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 158
> I: Comment: del packages (unnecessary-pkg)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 148
> I: Comment: add packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 153
> I: Comment: upd packages (httpd)
>
> !! You must supply a method for determining the version of existing packages
> I: Made in version 'not specified' of '/var/cfengine/inputs/foobar.cf' near
> line 158
> I: Comment: del packages (unnecessary-pkg)
>
> I'm using the cfgengine_stdlib.cf that came with the RPM of
> cfengine-community, here's the original yum package method from that file:
>
> body package_method yum
> {
> package_changes => "bulk";
> 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 -y install";
> package_delete_command => "/bin/rpm -e";
> package_verify_command => "/bin/rpm -V";
> }
>
> I assume that it's the package_list_version_regex is broken here? I see
> references to yum with 'freebsd' in various pages, which is baffling me since
> all the folks I know who use freebsd use apt.. Here is some output from
> redhat yum, to get an idea of what the regex is being fed:
>
> # yum list installed|grep httpd
> This system is not registered with RHN.
> RHN support will be disabled.
> httpd.x86_64 2.2.3-22.el5
> installed
> system-config-httpd.noarch 5:1.3.3.3-1.el5
> installed
>
> Any help appreciated!
> = Matt
> _______________________________________________
> Help-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/help-cfengine
>
--
Nicolas CHARLES
Normation SAS - http://www.normation.com
44 rue Cauchy – 94110 ARCUEIL
+33 (0)1 83 62 26 96 - +33 (0)6 14 63 25 18
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine