Proposing new functionality : to include or exclude pattern (regexp) when manipulating directories/files via file.recurse or file.directory
I have certain use cases where I need to include or exclude files, when manipulating directories/files via file.recurse or file.directory, instead of just syncing the whole directory.
Example:
(1) Sending selective files/directories from salt master (source area) to minions (destination).
(2) On minions, If certain applications is creating an additional data in a destination directory maintained via file.recurse, then preserve application data, instead of wiping it clean if files/directories are not present in the source.
I wrote a patch for states/file.py , hoping it can be included going forward. Please let me know if it is ok to initiate a pull request for above feature.
I think this would be a great feature, could we make it configurable to use regex or globs?
glob is an excellent idea. I made it default in my changes and regexp as an option with E@[PATTERN]. Just filed a pull request. please have a look.
I merged it, you did this in a great way, documented it well and the code looks good, I am really excited about this.