diff --git a/README.md b/README.md index 868c74a..440063c 100644 --- a/README.md +++ b/README.md @@ -38,8 +38,12 @@ mod "puppetlabs/ntp", mod "apache", :tarball => "https://forge.puppetlabs.com/puppetlabs/apache/0.6.0.tar.gz" -``` +#Deploy mysql module into modules/databases/mysql with the :subdir param +mod "mysql", + :git => "gitolite@myserver.com:mysql.git", + :subdir => "databases" +``` ## Setting up for development and running the specs Just clone the repo and run the following commands: ``` diff --git a/lib/librarian/puppet/simple/installer.rb b/lib/librarian/puppet/simple/installer.rb index 8506365..b54d02a 100644 --- a/lib/librarian/puppet/simple/installer.rb +++ b/lib/librarian/puppet/simple/installer.rb @@ -22,9 +22,12 @@ module Installer # iterator mixin def install! each_module do |repo| - print_verbose "\n##### processing module #{repo[:name]}..." - + module_path = module_path() + if repo[:subdir] + module_path = File.join(module_path, repo[:subdir]) + FileUtils.mkdir_p(module_path) unless File.exists?(module_path) + end module_dir = File.join(module_path, repo[:name]) unless File.exists?(module_dir)