|Hi help-cfengine,
I'm trying to use cfengine_stdlib.cf's definition of "package_method
yum" to remove some packages.
This is under RHEL5, with cfengine community 3.0.5p1.
Here's an example .cf that fails:
----
body common control {
inputs => {"cfengine_stdlib.cf"};
# sha1sum c0d0b9457b86bedacd914b6bf951188a1ed16e69
bundlesequence => {"main"};
}
bundle agent main {
vars:
"RHEL_virtualization_packages" slist => {
"rhn-virtualization-common",
"rhn-virtualization-host",
"libvirt-python", "libvirt" };
packages:
any::
"$(RHEL_virtualization_packages)"
package_policy => "delete",
package_method => yum;
}
----
Running this gives the result:
Q: rpm -e libvirt.* ...:error: package libvirt.* is not installed
Q: rpm -e libvirt.* ...:
rpm -e doesn't understand $(packagename).*.
I made the following modification to cfengine_stdlib.cf which seems to
address my problem, at least:
----
diff --git a/cfengine_stdlib.cf b/cfengine_stdlib.cf
index 30715fa..de9af0e 100644
--- a/cfengine_stdlib.cf
+++ b/cfengine_stdlib.cf
@@ -988,7 +988,7 @@ package_list_version_regex => "[^\s]\s+([^\s]+).*";
package_list_arch_regex => "[^.]+\.([^\s]+).*";
package_installed_regex => ".*installed.*";
-package_name_convention => "$(name).$(arch)";
+package_name_convention => "$(name)";
package_add_command => "/usr/bin/yum -y install";
package_delete_command => "/bin/rpm -e";
----
However, I don't know if this might break something else.
Comments/suggestions welcome.|
--
Jim Lawson
Systems Architecture & Administration
Enterprise Technology Services
University of Vermont
Burlington, VT USA
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine