Ask Your Question

Managing Dynamic File Generation

asked 2015-08-14 07:19:55 -0600

jacktravine gravatar image

updated 2015-08-14 07:20:24 -0600

I am running puppet 3.3.2. I am trying to understand what would be the best solution to generate a file dynamically from code blocks within a manifest file. As an example to better illustrate the ask would be /etc/hosts. I have the below file as a generic template however I want to use that as a template for all my hosts, and if I wanted to add an additional entry I would inherit the module and just append my new host line. In essence I want to be able to dynamically manage the file on each run, so if I remove an entry from my manifest it also formats accordingly.

My config:

# hosts entry added by post kickstart pupmaster-bob-01

Want to add line: pupmaster-suzy-01
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-08-14 09:45:23 -0600

example422 has a pretty cool module to manage this - have a look at cool module

its pretty flexible which is useful if you want to make this more complex going forward.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-08-14 07:19:55 -0600

Seen: 149 times

Last updated: Aug 14 '15