Reputation: 5000
I am looking for a way to compile Puppet Manifests and Custom Functions in Puppet Agent, like Chef.
Is it possible?
Use case 1. I want to check for file existence of some files in client side and do some actions. (For example, If file1.txt is present, install this package)
Use case 2. I want to execute something for files with particular extensions in client side. All the files are in client side only. (file1.txt, file2.csv, file3.txt, file4.py copy only the files with *.txt extension to some other directory )
How can I solve the above 2 use cases?
Thanks in advance.
Upvotes: 0
Views: 509
Reputation: 917
This is not too clear, as the relationship between your points is not obvious. I will try to answer :
There are several ways to achieve this, all using puppet apply
:
puppet apply --catalog
.puppet apply --catalog
.This is done with custom facts. If you are running puppet apply
, you can also use the file
function to read the content of a file. But what you describe doesn't seem to be a great use case for Puppet. Running commands on files or copying them is best done with a simple shell script.
Upvotes: 1