Hi,

You are over-engineering your solution, this will achieve the same result :

files:
    "/etc/application/"
     perms => system("0644","root","root"),
     copy_from => mycopy( "/my/repository/config/files/", "servername" ),
     file_select  => by_name("*.conf"),
     depth_search => recurse("1");

You'll be copying all files from the /my/repository/config/files/ 
folder, whose extension is .conf

(I didn't actually try this code, typos might be included)

Regards
Nicolas

On 31/03/2012 07:49, no-re...@cfengine.com wrote:
> Forum: CFEngine Help
> Subject: Matching files and replacing files with regex
> Author: Devastator101
> Link to topic: https://cfengine.com/forum/read.php?3,25425,25425#msg-25425
>
> Hi guys,
>
> I would like to know how to replace files using regex built in cfengine.  I 
> would like to replace .conf files in a client with the .conf files from the 
> configuration server.  Below is the code I have created.
>
>     "/etc/application/(^(.*)\.)+conf"
>      perms =>  system("0644","root","root"),
>      copy_from =>  mycopy( "/my/repository/config/files/$(match.2)", 
> "servername" );
>
>
> Can anybody help me with this.
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to