Permalink
Browse files

Simple utility to create Puppet module directory structure.

  • Loading branch information...
1 parent 287648c commit 4f908f7113035755ecd4d097dfad18227fb2eb7d @relistan committed with Outage User Jan 15, 2011
Showing with 31 additions and 0 deletions.
  1. +31 −0 mkmodule
View
@@ -0,0 +1,31 @@
+#!/usr/bin/env ruby
+
+require 'fileutils'
+
+# Create the directory structure of a Puppet module
+
+output_path = ARGV[0]
+
+if ARGV.empty?
+ puts "Usage: mkmodule <output_path>"
+ exit
+end
+
+puts "Creating directory structure at #{output_path}"
+
+# Build the Puppet module output directory structure
+%w{
+ /files
+ /manifests
+ /lib
+ /lib/puppet
+ /lib/puppet/parser
+ /lib/puppet/provider
+ /lib/puppet/type
+ /lib/facter
+ /templates
+}.each do |dir|
+ new_dir = File.join(output_path, dir)
+ puts "Creating... #{ new_dir }"
+ FileUtils.mkdir_p("#{ new_dir }")
+end

0 comments on commit 4f908f7

Please sign in to comment.