Hi,

I have a cfengine config that's not quite doing what I expect. I have a 
bundle that's set to install certain packages, and then adds some config 
files based on what's been installed. Slightly paraphrasing, the config 
I have looks like this:-


packages:
        any::
            "$(base_list)"
                package_policy => "add",
                package_method => "apt",
                classes => if_ok("class_foo");

        dell_machine::
             "$(dell_extras)
                package_policy => "add",
                package_method => "apt",
                classes => if_ok("class_bar");


files:
        class_foo::

                <some promises for all machines>

        class_bar::

                <some extra promises for Dell machines>


I have other config that sets the dell_machine class if the server it's 
running on is a Dell, and that works reliably.

What I expect to see from this is that on a non-Dell machine, class_foo 
gets set, and on a Dell machine, both class_foo and class_bar get set. 
What actually happens is that if the machine is a Dell, *only* class_bar 
is getting set, resulting in those machines failing to get the global 
configuration applied, as class_foo never gets set.

Is there a "preferred" way to fix this sort of thing? Either the if_ok 
body isn't doing what I expect it to do, or I've misunderstood 
something, so if anyone can point me in the right direction on how it 
actually works, that would be great.

Thanks,

Mike

P.S. For reference, the if_ok body is from the standard library, and is 
specifically defined as:-

body classes if_ok(x)
{
promise_repaired => { "$(x)" };
promise_kept => { "$(x)" };
}
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to