Forum: CFEngine Help
Subject: Re: path_name in file_select creating empty directories
Author: bbomgardner
Link to topic: https://cfengine.com/forum/read.php?3,23726,23730#msg-23730

Try using exclude_dirs in your depth_search body.  I think this will be more 
appropriate that using file_select.


vars:
"excluded_dirs" slist => {
   "$(g.local_generic_source)/devVMs_static/apache_conf_dir/mods-enabled.*",
   "$(g.local_generic_source)/devVMs_static/apache_conf_dir/mods-available.*",
   "$(g.local_generic_source)/devVMs_static/apache_conf_dir/sites-enabled.*",
   "$(g.local_generic_source)/devVMs_static/apache_conf_dir/sites-available.*",
  };
files:
"/etc/apache2/."
 comment       =>    "verify apache config directory is up to date",
 create        =>    "true",
 copy_from     =>    
no_backup_dcp_purge("$(g.local_generic_source)/devVMs_static/apache_conf_dir/"),
 depth_search  =>    recurse_except("inf",@(excluded_dirs)),
 classe        =>    if_repaired("restart_apache");
  
body depth_search recurse_except(d,ex)
{
depth => "$(d)";
xdev  => "true";
exclude_dirs => { @(ex) };
}


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

Reply via email to