'Check the hash of files by saltstack when copying

I'm interesting in how saltstack checks

  1. if file already exists
  2. if file is not corrupted

when it copies files.

Does it check hash sum of file and its content, or only file names? Especially when file.recurse state is used for copying directories.

Does anybody know how to iterate through the directory content and check hash sum for files?

I understand that here is a few questions, but it is important to imagine the big picture of copying process.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source