Ask Your Question

Customize file with unique client information

asked 2013-10-22 13:08:26 -0500

Idavis gravatar image

My team is starting to use Puppet to configure and maintain a group of about 20 kiosk-type machines and I am wondering if there is a way to put place-holders in a file to be filled in by unique system information with Puppet. One example is with the wireless configuration file found in /etc/NetworkManager/system-connections. Here is a part of the file we are trying to customize when pushed out to the clients.



We would like to have ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2013-10-22 22:12:38 -0500

lavaman gravatar image

Neither Hiera nor Parameterized Classes, while both quite useful, actually answer the original question. The method by which data is populated in to formatted files in Puppet is via templates. They are embedded ruby syntax template files evaluated by puppet to insert data from several sources (facter/hiera/manifests).

See here for more info:

edit flag offensive delete link more


This is a good point. I made a most-likely false assumption that a template was already being used.

Ancillas gravatar imageAncillas ( 2013-10-23 09:54:37 -0500 )edit

answered 2013-10-22 14:46:41 -0500

Ancillas gravatar image

You could use Hiera and Parameterized Classes.

Simply put, your classes/modules will provide sane defaults for this file, and then you'll use Hiera to override those defaults.

In this case, you might use a client ID in your hiera hierarchy (that'll make more sense once you read up on hiera). When you're running your code on client A's server, their config options will be sourced from A.yaml, however when running on client B's server, their config would be pulled form B.yaml. In this way, you'd have only one piece of code ... (more)

edit flag offensive delete link more


Thanks, I'll take a look at Hiera and see what I can learn.

Idavis gravatar imageIdavis ( 2013-10-22 15:03:03 -0500 )edit

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: 2013-10-22 13:08:26 -0500

Seen: 150 times

Last updated: Oct 22 '13