Forum: CFEngine Help
Subject: Re: Why does CFEngine 3.2.0 consider running a process_stop command as
a promise kept?
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,23210,23475#msg-23475
I do not think that ifvarclass defines a class. That would be illogical.
However we can test:
neil@ettin ~/.cfagent/inputs $ cat test.cf
body common control
{
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"bar" string => "bar";
reports:
cfengine_3::
"One",
ifvarclass => "${bar}";
bar::
"Two";
}
I would expect to see one or both reports if the class bar is defined by this
bundle.
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./test.cf
neil@ettin ~/.cfagent/inputs $
I believe the correct way is this.
body common control
{
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"bar" string => "bar";
classes:
"${bar}" expression => "cfengine_3";
reports:
cfengine_3::
"One",
ifvarclass => "${bar}";
bar::
"Two";
}
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./test.cf
R: One
R: Two
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine