Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: toddnni
Link to topic: https://cfengine.com/forum/read.php?3,23180,23211#msg-23211
Hi davidlee,
I dare to say that your example with ifvarclass
class:
"runtime_condition" and => { ...foo ; bar ... };
vars:
v string => "
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,23180,23206#msg-23206
Many thanks for looking at this.
BTW, whenever I send requests like this, I try to do so from two different
viewpoints:
(1) as a user: m
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: mark
Link to topic: https://cfengine.com/forum/read.php?3,23180,23205#msg-23205
These solutions should certainly work. I can't specifically recall any bugs
relating to this, but we cover a lot of ground in a few releases.
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,23180,23204#msg-23204
I see what you mean Diego. I'd like one of the CF developers to chime in and
tell us what the expected behaviour is. It seems reason
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: zzamboni
Link to topic: https://cfengine.com/forum/read.php?3,23180,23203#msg-23203
Neil, you are correct with respect to the order of execution. However, why does
my example work correctly (at least in 3.2.0)? I'm trying
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: zzamboni
Link to topic: https://cfengine.com/forum/read.php?3,23180,23202#msg-23202
David, the only explanation that occurs to me is that I tried this with
cfengine 3.2.0b3, so maybe the behavior has changed a little bit.
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,23180,23200#msg-23200
Vars promises are before classes. I would expect that the variable would not
be defined until the second run. However, the report is
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. Hi
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,23180,23197#msg-23197
Your reports section looks like this.
reports:
cfengine_3::
"foo: $(foo)";
"conditional: $(conditional)";
I think it should look li
On 24-08-11 11:47, no-re...@cfengine.com wrote:
> body common control
> {
>bundlesequence => { "test" };
> }
>
> bundle agent test
> {
> classes:
>"runtime_condition" expression => fileexists("/tmp/foo");
>
> vars:
>"foo" string => "bar";
>runtime_condition::
> "conditional"
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: davidlee
Link to topic: https://cfengine.com/forum/read.php?3,23180,23193#msg-23193
Thanks, Diego, particularly for the worked example.
It so happens that I had actually tried that approach, but it didn't seem to
work.
Forum: CFEngine Help
Subject: Re: conditional setting of a variable
Author: zzamboni
Link to topic: https://cfengine.com/forum/read.php?3,23180,23182#msg-23182
David,
ifvarclass indeed does not work inside the vars: section (I agree this would be
nice), but you can use the traditional class-expr
12 matches
Mail list logo