Forum: CFEngine Help
Subject: Defining a default action_policy (warn vs fix) for all promise types?
Author: FraserCampbell
Link to topic: https://cfengine.com/forum/read.php?3,27127,27127#msg-27127
I need to define policy in such a way that some classes of systems experience
automatic change and some do not, simplistically like this:
body copy_from local_cp(from) {
any::
source => "$(from)";
compare => "digest";
PROD.!MAINTENANCE::
action_policy => "warn";
MAINTENANCE|!PROD::
action_policy => "fix";
}
My concern with this is that I don't see a way to set a default action_policy.
It looks like I'll need to redefine all the standard library bodies and bundles
that I choose to use in order to ensure appropriate action_policy.
It would be great to be able to define a copy_from defaults, an edit_line
defaults, a promises defaults, etc so that we would have to explicitly hard
code the action_policy into every promise. ... we could still override the
default where needed but otherwise would be assured that our intended warn/fix
policy is in place.
Also, for packages I don't see a package_policy option, this would be useful
for where we want to only be warned that a package is missing.
Any ideas on the most efficient way to do this? All that jumps to mind is to
begin redefining all of the "functions" I need from the cfengine stdlib into my
own local lib with the necessary adjustments ... I'm hoping there is another
way as I'm still quite new to CF3.
Thanks!
Fraser
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine