Most are familiar with the puppetdoc command. It prints out documentation about various aspects of your puppet environment in markdown format. I've always been interested in having a way to collect the documentation on our puppet resource types (including ones we build) and automatically generating Confluence pages for each of them. Unfortunately Confluence doesn't support Markdown and puppetdoc doesn't support passing in an erb file. So we'll have to just do it ourselves. All we have to do is load up all of our puppet types, then take each one and run it through an ERB template. From there we can do whatever we want.
Simple enough? And here's our ERB:
That will generate Confluence friendly documentation. Of course you can modify it to do whatever you like. For those interested, here's my entire code I use to generate my Confluence pages. You'll probably want to modify it to suit your needs. I modified this module some else wrote Confluence4r
0 comments:
Post a Comment