From ca6b95b19c7456994cf51c47bdb9a4ce00e81b74 Mon Sep 17 00:00:00 2001 From: Craig Tracey Date: Mon, 14 May 2012 18:09:01 -0400 Subject: [PATCH 1/3] Add support for alternative modulepath --- Rakefile | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index 9ef7ff1..ff31fcd 100644 --- a/Rakefile +++ b/Rakefile @@ -7,22 +7,25 @@ require 'puppet' -repo_file = 'other_repos.yaml' +repo_file = 'other_repos.yaml' +default_modulepath = '/etc/puppet/modules' namespace :modules do desc 'clone all required modules' task :clone do repo_hash = YAML.load_file(File.join(File.dirname(__FILE__), repo_file)) repos = (repo_hash['repos'] || {}) + modulepath = (repo_hash['modulepath'] || default_modulepath) repos_to_clone = (repos['repo_paths'] || {}) branches_to_checkout = (repos['checkout_branches'] || {}) repos_to_clone.each do |remote, local| # I should check to see if the file is there? - output = `git clone #{remote} #{local}` + outpath = File.join(modulepath, local) + output = `git clone #{remote} #{outpath}` Puppet.debug(output) end branches_to_checkout.each do |local, branch| - Dir.chdir(local) do + Dir.chdir(File.join(modulepath, local)) do output = `git checkout #{branch}` end # Puppet.debug(output) @@ -33,14 +36,15 @@ namespace :modules do task 'status' do repo_hash = YAML.load_file(File.join(File.dirname(__FILE__), repo_file)) repos = (repo_hash['repos'] || {}) + modulepath = (repo_hash['modulepath'] || default_modulepath) repos_to_clone = (repos['repo_paths'] || {}) branches_to_checkout = (repos['checkout_branches'] || {}) repos_to_clone.each do |remote, local| # I should check to see if the file is there? - Dir.chdir(local) do + Dir.chdir(File.join(modulepath, local)) do puts "Checking status of #{local}" puts `git status` end end end -end +end From af66ddc422dd05f7d35a70d01503db29cc2e6a57 Mon Sep 17 00:00:00 2001 From: Craig Tracey Date: Mon, 14 May 2012 18:16:04 -0400 Subject: [PATCH 2/3] Update repos file to support alternative modulepath support --- other_repos.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/other_repos.yaml b/other_repos.yaml index 0cf866a..2a84b86 100644 --- a/other_repos.yaml +++ b/other_repos.yaml @@ -1,25 +1,25 @@ repos: repo_paths: # openstack git repos - git://github.com/puppetlabs/puppetlabs-nova: /etc/puppet/modules/nova - git://github.com/puppetlabs/puppetlabs-glance: /etc/puppet/modules/glance - git://github.com/puppetlabs/puppetlabs-swift: /etc/puppet/modules/swift - git://github.com/puppetlabs/puppetlabs-keystone: /etc/puppet/modules/keystone - git://github.com/puppetlabs/puppetlabs-horizon: /etc/puppet/modules/horizon + git://github.com/puppetlabs/puppetlabs-nova: nova + git://github.com/puppetlabs/puppetlabs-glance: glance + git://github.com/puppetlabs/puppetlabs-swift: swift + git://github.com/puppetlabs/puppetlabs-keystone: keystone + git://github.com/puppetlabs/puppetlabs-horizon: horizon # openstack middleware - git://github.com/puppetlabs/puppetlabs-rabbitmq: /etc/puppet/modules/rabbitmq - git://github.com/puppetlabs/puppetlabs-mysql: /etc/puppet/modules/mysql - git://github.com/puppetlabs/puppetlabs-git: /etc/puppet/modules/git - git://github.com/puppetlabs/puppetlabs-vcsrepo: /etc/puppet/modules/vcsrepo - git://github.com/saz/puppet-memcached: /etc/puppet/modules/memcached - git://github.com/puppetlabs/puppetlabs-rsync: /etc/puppet/modules/rsync + git://github.com/puppetlabs/puppetlabs-rabbitmq: rabbitmq + git://github.com/puppetlabs/puppetlabs-mysql: mysql + git://github.com/puppetlabs/puppetlabs-git: git + git://github.com/puppetlabs/puppetlabs-vcsrepo: vcsrepo + git://github.com/saz/puppet-memcached: memcached + git://github.com/puppetlabs/puppetlabs-rsync: rsync # other deps - git://github.com/ghoneycutt/puppet-xinetd: /etc/puppet/modules/xinetd - git://github.com/saz/puppet-ssh: /etc/puppet/modules/ssh - git://github.com/puppetlabs/puppetlabs-stdlib: /etc/puppet/modules/stdlib - git://github.com/puppetlabs/puppetlabs-apt: /etc/puppet/modules/apt - git://github.com/ripienaar/puppet-concat: /etc/puppet/modules/concat + git://github.com/ghoneycutt/puppet-xinetd: xinetd + git://github.com/saz/puppet-ssh: ssh + git://github.com/puppetlabs/puppetlabs-stdlib: stdlib + git://github.com/puppetlabs/puppetlabs-apt: apt + git://github.com/ripienaar/puppet-concat: concat checkout_branches: -# /etc/puppet/modules/keystone: dev -# /etc/puppet/modules/glance: dev -# /etc/puppet/modules/nova: dev +# keystone: dev +# glance: dev +# nova: dev From a7e2cd5283480db5421153c3404969100d336342 Mon Sep 17 00:00:00 2001 From: Craig Tracey Date: Mon, 14 May 2012 18:19:15 -0400 Subject: [PATCH 3/3] Add example usage of modulepath --- other_repos.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/other_repos.yaml b/other_repos.yaml index 2a84b86..db07b59 100644 --- a/other_repos.yaml +++ b/other_repos.yaml @@ -1,3 +1,4 @@ +# modulepath: /etc/puppet/modules repos: repo_paths: # openstack git repos