Ask Your Question
0

Managing Dynamic File Generation

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

jacktravine gravatar image

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

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:

#/etc/hosts
# hosts entry added by post kickstart
122.122.122.1 pupmaster-bob-01.helloworld.com pupmaster-bob-01

Want to add line:

123.123.123.1 pupmaster-suzy-01.helloworld.com pupmaster-suzy-01
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Stats

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

Seen: 121 times

Last updated: Aug 14 '15