Add auto create_key task to rakefile

To eliminate one more step in the process of running our repo steps,
added create_key task and made the test task depend upon it.

The other manual step is to run the berk_vendor task, but I hesitate
to include that in the test tasks as most developers are always messing
around with the code and would not like it blown away all the time.

Change-Id: I57c4fd8118c289386552e0ed1087959883724ec4
This commit is contained in:
Mark Vanderwiel 2015-03-11 15:56:52 -05:00
parent aa48cfbb43
commit 8f4a96e398
2 changed files with 11 additions and 5 deletions

View File

@ -22,7 +22,6 @@ $ git clone https://github.com/jjasghar/chef-openstack-testing-stack.git testing
$ cd testing-stack
$ vi vagrant_linux.rb # change the 'vm.box' to the openstack platform you'd like to run.
$ chef exec rake berks_vendor
$ chef exec ruby -e "require 'openssl'; File.binwrite('.chef/validator.pem', OpenSSL::PKey::RSA.new(2048).to_pem)"
```
The stackforge OpenStack cookbooks by default use databags for configuring passwords. There are four

View File

@ -26,23 +26,30 @@ task :berks_vendor do
run_command('berks vendor cookbooks')
end
desc "Create Chef Key"
task :create_key do
if not File.exist?('.chef/validator.pem')
sh %(chef exec ruby -e "require 'openssl'; File.binwrite('.chef/validator.pem', OpenSSL::PKey::RSA.new(2048).to_pem)")
end
end
desc "All-in-One Neutron build"
task :aio_neutron do
task :aio_neutron => :create_key do
run_command('chef-client -z vagrant_linux.rb aio-neutron.rb')
end
desc "All-in-One Nova-networking build"
task :aio_nova do
task :aio_nova => :create_key do
run_command('chef-client -z vagrant_linux.rb aio-nova.rb')
end
desc "Multi-Neutron build"
task :multi_neutron do
task :multi_neutron => :create_key do
run_command('chef-client -z vagrant_linux.rb multi-neutron.rb')
end
desc "Multi-Nova-networking build"
task :multi_nova do
task :multi_nova => :create_key do
run_command('chef-client -z vagrant_linux.rb multi-nova.rb')
end