I am using the yum package_method from cfengine_stdlib.cf. I wanted to
install the rpm that installs the Postgres YUM repository and its key.

I wanted to simply use the yum "is this installed" detection to set a class
and run a command, but promise_not_kept is not valid in a package: body.

I found rpm_version in the open promise body library. It checks for every
package installed on my system, not just the one I'm trying to install, but
otherwise it's mostly what I needed.

package_name_convention was

package_name_convention => "$(name)-$(version)-$(arch).rpm"

so it kept failing to find a package of that name in the repository, with
the error message:

cf3  -> Package promises to refer to itself as
"pgdg-fedora-8.4-2-noarch.rpm" to the manager
cf3  -> Package version seems to match criteria
cf3 No package in file repositories satisfy version constraint
...
cf3 Outcome of version 0.1 (agent-0): Promises observed to be kept 100%,
Promises repaired 0%, Promises not repaired 0%

Eventually I figured out that means package_name_convention should be:

package_name_convention => "$(name)-$(version).$(arch).rpm"

and it works.

Daniel
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to