Forum: CFEngine Help
Subject: Re: passing lists to external body parts (Was: Re: indentation and
insert_lines)
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,27201,27269#msg-27269
I'm pretty sure this is because the list isn't actually passed - a name of the
list
Forum: CFEngine Help
Subject: Re: indentation and insert_lines
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,27160,27268#msg-27268
Gregory Matthews Wrote:
---
> The only other way to do it that I've found is to
>
There are two ways to pass lists to functions in CFEngine (search for
"pass lists" in the reference manual): by parametrization, or by using
the fully qualified name of a list variable.
There is no mention of passing lists to bodies in the CFEngine
Reference Manual. (Correct me if I'm mistaken.)
Thanks both for the help. Some things to think about there. I've used
set_variable_values before for other config files but I feel that in
this case, it results in an overly wordy .cf file. I've also used
templates in certain circumstances. I will consider this further.
thanks again
GREG
On 0
I agree - for the specific example, set_variable_values seems like a good way
of doing it. You could also use a template with edit_template, and just insert
the values that you want, then the file will preserve the formatting from the
template.
--Diego
On Sep 3, 2012, at 3:37 PM, Nick Anderson
On 09/03/2012 05:10 AM, Gregory Matthews wrote:
On 31/08/12 17:30, Diego Zamboni wrote:
Greg,
You could split the lines into a list, then you can still pass them to
insert_lines but they will not be indented. Just separate them by
commas in your code, should work fine.
undle agent test {
> On 31/08/12 17:30, Diego Zamboni wrote:
>> Greg,
>>
>> You could split the lines into a list, then you can still pass them to
>> insert_lines but they will not be indented. Just separate them by
>> commas in your code, should work fine.
the only way I've found to make it work is thus:
body comm
that would be nice wouldn't it? however, the following code does not work:
body common control
{
bundlesequence => { "test" };
inputs => { "cfengine_stdlib.cf",
"dls_std_lib.cf" };
}
bundle agent test {
vars:
files:
"/tmp/ifcfg-eth0-range0"
create => "true"
Greg,
You could split the lines into a list, then you can still pass them to
insert_lines but they will not be indented. Just separate them by
commas in your code, should work fine.
--Diego
On Aug 31, 2012, at 7:56 AM, Gregory Matthews
wrote:
> how do ppl reconcile indentation for readability