Details
-
Type:
Bug
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Promise type: packages
-
Labels:None
Description
New packages promise requires @package_module@ to be explicitly specified in the policy as per https://github.com/cfengine/core/blob/a2dfa030ade338e7bb4206f5f2d8b7b2ea32f2e4/cf-agent/verify_new_packages.c#L34
But, the docs have examples without the @package_module@ attribute. This is misleading.
Doc url: https://docs.cfengine.com/docs/3.7/reference-promise-types-packages.html
Either update the doc saying it's mandatory to have @package_module@ attribute, or it would be awesome to make the attribute optional. Let CFEngine determine if it should be yum or apt-get, if neither is specified.
Steps to reproduce:
policy like the below:
<pre>
packages:
centos::
"$(tools_and_libs)"
policy => "present";
</pre>
Error thrown:
<pre>
error: Can not find package module body in policy.
error: New package promise failed sanity check.
error: Can not find package module body in policy.
error: New package promise failed sanity check.
</pre>
But the below one works fine
<pre>
packages:
centos::
"$(tools_and_libs)"
policy => "present",
package_module => yum,
architecture => "x86_64";
</pre>
Have checked only on CentOS 7.1, but I think it should be same in Ubuntu as well.