Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,23180,23198#msg-23198

Thanks, Neil.  Actually I think Diego's (zzamboni's) original "reports" was 
correct, but the use of ":" is overloaded at first sight.  His reports were, I 
believe, deliberately intended to print "$(conditional)" under all 
circumstances:

==========
reports:

  cfengine_3::
    "foo: $(foo)";
    "conditional: $(conditional)";
==========

the two lines 'foo:...' and 'conditional:' to be interpreted as "the value of 
'foo' is..." and "the value of 'conditional' is...", but ALWAYS to display the 
value in this test-case example.  The idea is deliberately to print under all 
circumstances, showing that the variable "conditional" is set when the file is 
present and showing (still printing) that it is unset when the file is absent.

His test-case and his output show exactly what I would have expected.

Now the problem that I have is that in my environment, which is community-3.1.4 
on RHEL 5.6, is that the variable 'conditional' does not seem to be set, even 
when the file is present.

Diego's example demonstrates exactly what I hoped it should.  But in my use of 
it, something, somewhere is buggy.

Any ideas?

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to