Details
-
Type:
Story
-
Status: Done
-
Priority:
(None)
-
Resolution: Fixed
-
Affects Version/s: 3.15.3, 3.17.0
-
Component/s: Masterfiles Policy Framework (MPF/COPBL/STDLIB)
-
Labels:None
Description
It would be nice if I could write a policy that inclused just packages.cf from the standard library and be able to use package modules explicitly.
Currently doing so results in errors because the package promise fails sanity check for query_installed_ifelapsed and query_updates_ifelapsed. (they are both currently sourced from def).
Example:
body file control { inputs => { "$(sys.libdir)/stdlib.cf" }; } bundle agent manage_ntp { vars: "ntp_package_name" string => "ntp"; packages: centos|redhat:: "$(ntp_package_name)" -> { "StandardsDoc 3.2.1" } policy => "present", package_module => yum, handle => "manage_ntp_packages_$(ntp_package_name)_rpm", classes => if_ok("ntp_installed"); debian|ubuntu:: "$(ntp_package_name)" -> { "StandardsDoc 3.2.1" } policy => "present", package_module => apt_get, handle => "manage_ntp_packages_$(ntp_package_name)_deb", classes => if_ok("ntp_installed"); } bundle agent __main__ { methods: "manage_ntp"; }
[root@hub ~]# cf-agent -KIf /tmp/ensure_ntp.cf error: Invalid or missing arguments in package_module body 'yum': query_installed_ifelapsed = -678 query_updates_ife error: New package promise failed sanity check. error: Invalid or missing arguments in package_module body 'yum': query_installed_ifelapsed = -678 query_updates_ife error: New package promise failed sanity check. error: Invalid or missing arguments in package_module body 'yum': query_installed_ifelapsed = -678 query_updates_ife error: New package promise failed sanity check. error: Method 'manage_ntp' failed in some repairs