help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to use iteration over list variable in copy action ? (text mode)


From: Yves Blusseau
Subject: Re: How to use iteration over list variable in copy action ? (text mode)
Date: Thu, 12 Jan 2006 17:35:10 +0100

Hi,

No it's doesn't work because cfengine don't allowed to copy file to 
directory !
So if the source is a plain file the dest MUST be a plain file ! (this is 
the problem).

Yves

> If you leave the dest= directive as a path with no filename, i.e. 
> dest=/tmp/, does that work?  I don't have any examples of doing a copy 
> like that in my cf.* files, but I can't imagine any other way they would 
> have implemented iteration.
>
> Paul Krizak                         5900 E. Ben White Blvd. MS 625
> Advanced Micro Devices              Austin, TX  78741
> Linux/Unix Systems Engineering      Phone: (512) 602-8775
> Microprocessor Solutions Sector
>
>
> Yves Blusseau wrote:
>> Hi, all,
>>
>> I want to use a list to copy some files.
>>
>> The tutorial manual said that the list can be use only in the "from" 
>> field of a copy action:
>> It is convenient to be able to use such variables to force cfagent to 
>> iterative over a list. This gives us a compact way of writing repeated 
>> operations and it allows a simple method of communication with the shell 
>> environment. For security reasons, iteration is supported only in the 
>> following contexts:
>>  * in the `from' field of a copy action
>>
>> I write this little script:
>> ...
>> control:
>>     listOfFiles = ( foo:bar:baz )
>> ...
>> copy:
>>     any::
>>         $(my_cfconfigs)/files/$(listOfFiles)   dest=/tmp/$(listOfFiles) 
>> server=$(policyhost)
>> ...
>>
>>
>> But the above fails, since it try to copy every files (foo, then bar, 
>> then baz) to /tmp/foo:bar:baz (the list in dest isn't split).
>> So how to write a copy action with a list of source files ?
>>
>> Thanks in advance.
>> Yves
>>
>>
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@gnu.org
>> http://lists.gnu.org/mailman/listinfo/help-cfengine
>
>
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]