Ask Your Question
1

Default header to every file that puppet managed

asked 2014-03-21 10:05:54 -0500

updated 2014-03-30 16:09:53 -0500

Anyone have any ideas on adding a default header to puppet managed files and templates? like every file that puppet managed put a header like this:

##############################################################################' "## This file is centrally managed, any manual changes will be OVERWRITTEN #" ###############################################################################'

at the moment I am editing my files in puppet master with this header but I would like this automatically.

edit retag flag offensive close merge delete

Comments

I'd like to see this feature in puppet. Maybe open an enhancement request?

spuder gravatar imagespuder ( 2014-03-25 18:19:09 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-03-21 23:05:26 -0500

richburroughs gravatar image

I'm not sure there's a way to do that. Part of the problem is that different types of files have different commenting styles.

We put them in manually where I'm at, at the top of the ERB template. Sometimes they're XML files , sometimes YAML, sometimes other formats. We put a note in using the appropriate type of comment.

I believe that Puppet will automatically do this for certain things, like in a crontab that it's managing.

It's possible there is a way to do it across the board that I'm not aware of.

edit flag offensive delete link more

Comments

I'll try to make a module to do that :D

Renan Vicente gravatar imageRenan Vicente ( 2014-03-24 21:00:07 -0500 )edit
0

answered 2014-03-25 16:10:39 -0500

It's a good idea, but I agree with richburroughs. I originally thought perhaps the concat or datacat module could help, but I don't think it could. Your issue would come when needing to add the comment to different file types. You could use a concat resource, with order => 1, and wrap it around a defined type resource which took the filename as an argument. That would then apply the same concat resource to multiple files, but would restrict every file to be a concat resource.

You also mention "every file that puppet managed" ... if you could somehow retrieve ... (more)

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

2 followers

Stats

Asked: 2014-03-21 10:05:54 -0500

Seen: 1,389 times

Last updated: Mar 30 '14