Quick creation of Puppet Modules

April 28th, 2010 | Posted by ProfFalken in DevOps | Linux | Open-Source

I’ve been playing with Puppet for some time now and creating the directory structure for modules as defined in the puppet best practice guide gets tedious after a while, so I threw together a simply base script that takes a single argument and builds the directory structure for you.

Create a file named puppet_mcreate, make sure it is executeable (chmod +x puppet_mcreate) and put it in your path somewhere (/usr/local/bin for example).

Fill the file with the following content:

mkdir -pv $1/{files,manifests,lib/{puppet/{parser,provider,type},facter},templates}
touch $1/manifests/init.pp
chown -Rf puppet: $1
vim $1/manifests/init.pp

now you just need to run

puppet_mcreate <moduleName>

when ever you want to create a new module.

You can follow any responses to this entry through the RSS 2.0 You can leave a response, or trackback.

One Response



Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Switch to our mobile site