Forum: CFEngine Help Subject: Re: Cfengine Help: Re: Advice on using package promises Author: jgreer Link to topic: https://cfengine.com/forum/read.php?3,22694,22733#msg-22733
Sven, You're bumping into a couple problems: - current releases are subject to a bug in code that compares the version requested in policy against installed versions: https://cfengine.com/bugtracker/view.php?id=562. The new release candidate for 3.2.0 contains a fix; I encourage you to test against that. - there were problems in my previous post - the package_method body I was using compared the "-" of the requested package against just "version" of installed - see this line in your post: Check for compatible versioning model in (1.6.11-7.el5,1.4.2) This will get you closer to what you want. The effect in releases prior to 3.2.0 should be that subversion will be installed if no version is installed, and every agent run will attempt to update to 1.6.11-7.el5 (even if it's already installed). Hope this is helpful. -Jessica bundle agent packagesClient { packages: "subversion" package_policy => "addupdate", package_method => yum_rpm_exact, package_version => "1.6.11-7.el5", package_architectures => { "x86_64" }, action => actionsettings_fix_inform("inform"); } ## You must specify "package_version" in any promises where this body is used! ## Otherwise, the version gets set to "*", which causes Cfengine to refer to ## the package in terms of package-* (see package_name_convention) - which ## could install or delete packages unintentionally. body package_method yum_rpm_exact { package_changes => "individual"; package_list_command => "/bin/rpm -qa --qf '%{name} %{version}-%{release} %{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).$(arch)"; package_add_command => "/usr/bin/yum -y install"; package_update_command => "/usr/bin/yum -y update"; package_delete_command => "/usr/bin/yum -y erase"; package_verify_command => "/bin/rpm -V"; } _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine