How can I find a file in a directory on the node by using shell-patterns or regex?
What I want to do:
I download a tar file to /tmp/myfiles on the appropriate client and unpack this archive. From it come several deb files (about 10 of them). The filenames change with time, because there are version numbers integrated in the name.
The file names looks like:
package1_8.0-22.65.linux.x86_64.debpackage2_6.5-23.89.linux.x86_64.deb
I need to identify some of them (not all) to be able to install them via package with provider => dpkg.
The packages (like package1, package2) do not occur multiple times with different version numbers, so matching could be done easily without having to compare version numbers:
- Shell pattern:
package1_*.linux.x86_64.deb - Regex:
^package1_.+\.linux\.x86_64\.deb$
Is there a command or module in Puppet to find files by match pattern in a directory?
Or can I grab the result of exec with command => "ls /tmp/myfiles/..." and evaluate it?