Ansible Find Example 0s – How to use Ansible Find
Excerpt The Ansible search module works similarly to the Find Linux command and allows searching files and folders based on various search criteria like file age, access date, modification date, expression search pattern regular, etc. As stated earlier, this is a more feasible way to run the Linux find command with an inbuilt standard, this module is designed. As stated earlier, this is a more efficient way to run the Linux find command with an existing standard. This module is intended for use on Linux servers only. For Windows, you should use the win_find module instead. Because this will also be the command to replace Linux Find. I will list all 0 examples equivalent to Linux Find. Example 01: Find all the log files older than 30 days with Ansible Find In this section, we are going to see how ansible find is going to help us find the more than 30 days old files. The Linux find Command Here is the command that you would ideally execute in the Linux OS find /var/log -name "*.log" -type f -mtime +30 The Ansible Find AdHoc Command The same Linux command can be rewritten as ansible ad hoc command as follows