Hi Ove, I'm pretty sure this will result in convergence problems when you would do it in one step. First CFengine will copy over all the *.template files from your source, and move them into place by removing the .template.
This would result in cfengine copying over the files from the source on every run since the local destination files are gone (every run it will compare the local copy against the remote copy and decide if it needs updating) On 6/9/11 10:45 AM, Ove Risberg wrote: > We want to do a recursive copy of all files in masterfiles ending > with .template to a template directory and .template should be removed > from the filename during the process. > > It would be nice if this could be done in one step but it does not looks > like it is possible. > > We have not found a way to remove .template from $(this.promiser) so we > use the workaround you see below were only one level of directories is > searched for files and we use pcre matching to remove .template. > > If someone knows how to do this for all files under this directory I > will be very happy. > > files: > "$(templates_dir)" > comment => "Copy the templates from masterfiles to templates", > handle => "update_files_templates_dir", > copy_from => u_rcp("$(master_location)","$(sys.policy_hub)"), > depth_search => u_recurse_ignore("inf",".git"), > file_select => u_by_name( ".*\.template" ), > action => u_immediate; > > "$(templates_dir)/.*/(.*)\.template" > comment => "Rename the templates from file.template to file", > handle => "update_files_templates_dir_rename", > rename => u_to("$(match.1)"), > action => u_immediate; > -- Sjoerd Oostdijck RIPE Network Coordination Centre RIPE NCC, IT Department Singel 258, Amsterdam, NL http://www.ripe.net +31 20 535 4444 _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine