rake_tasks: support Puppetfile_extras

In the case of puppet-tripleo, we would like to re-use
puppet-openstack_spec_helper/rake_tasks but we have more Puppet modules
than Puppet OpenStack, and some of them are third party (not supported
by any community).

So we would like to create a Puppetfile_extras with the modules specific to
TripleO and re-use Puppetfile from Puppet OpenStack.
This patch will merge the 2 Puppetfiles if Puppetfile_extras does exist in one
Puppet module.

Change-Id: I337fb246f326510a3bd459f777dc6a353f9d6924
This commit is contained in:
Emilien Macchi
2016-09-22 10:47:45 -04:00
parent b7d15cb11b
commit 1e8dc7f7a9
2 changed files with 11 additions and 0 deletions

View File

@@ -61,6 +61,11 @@ task :spec_prep do
else
sh("git clone https://git.openstack.org/#{repo} #{repo}")
end
# Allow to a repository to have extra modules that are not
# in puppet-openstack-integration
if File.exists?("#{Dir.pwd}/Puppetfile_extras")
sh("cat #{Dir.pwd}/Puppetfile_extras >> #{repo}/Puppetfile")
end
script = ['env']
script += ["PUPPETFILE_DIR=#{Dir.pwd}/spec/fixtures/modules"]
script += ["ZUUL_REF=#{zuul_ref}"]

View File

@@ -0,0 +1,6 @@
---
features:
- If Puppetfile_extras file does exist in a Puppet module, the spec_helper will copy
its content to the end of Puppet OpenStack Puppetfile. It will allow external modules
(for example puppet-tripleo) to re-use Puppet OpenStack tooling, but adding more modules
in the tests.