diff --git a/README.md b/README.md index 63c4dd6..8d6ae46 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Rakefile b/Rakefile index 074b72b..90b00aa 100644 --- a/Rakefile +++ b/Rakefile @@ -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