Forum: Cfengine Help
Subject: copy_from 'preserve' does not respect file_select
Author: jonb1987
Link to topic: https://cfengine.com/forum/read.php?3,21690,21690#msg-21690

It appears that the 'preserve' promise of the 'copy_from' body does not honour 
'file_select'.

I have this...


#----------------------------------------------------------
bundle agent sys_update {
#----------------------------------------------------------
   vars:
      any::
         "cf_source"   string => "$(sys.workdir)/inputs/whole_files";

   files:
      any::
         "/"
            file_select  => default_file_select,
            depth_search => recurse("inf"),
            copy_from    => default_copy_from("/");
}

#----------------------------------------------------------
body file_select default_file_select {
#----------------------------------------------------------
# Things NOT to match
leaf_name   => { "yp.conf",
                 "rsnapshot_primary.conf"
               };
# Assumption: this is for copy, so matching is done for "remote" (copy source) 
paths
path_name   => { "$(cf_source)/etc/cron.d/.*",
                 "$(cf_source)/etc/cups/.*"
               };

file_result => "(!path_name).(!leaf_name)";
}

#----------------------------------------------------------
body copy_from default_copy_from(p) {
#----------------------------------------------------------
   source      => "$(cf_source)$(p)";
   compare     => "digest";
   servers     => { "localhost" };
   copy_backup => "true";
   preserve    => "true";
}


What happens is that for the actualy copying the file_select is
honoured (i.e. yp.conf, /etc/cups/* etcdo NOT get copied),
but all files (including /etc/cups/ files DO get their permissions
modified as per the source files!

Am I missing something?

Thanks!

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to