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.