karthikeayan
karthikeayan

Reputation: 5000

Is there any way to compile Manifest, Custom Functions etc in Puppet Agent?

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

Answers (1)

bartavelle
bartavelle

Reputation: 917

This is not too clear, as the relationship between your points is not obvious. I will try to answer :

Masterless puppet

There are several ways to achieve this, all using puppet apply :

  • Store all the manifests files on the server and apply it.
  • Compile a catalog on a the master, and apply it on your server using puppet apply --catalog.
  • Compile a catalog using a third party tool, and also apply it using puppet apply --catalog.

Adjusting the content of the catalog based on the client state

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

Related Questions