summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorAdam Jacob <adam@opscode.com>2009-10-29 08:30:28 -0700
committerAdam Jacob <adam@opscode.com>2009-10-29 08:30:28 -0700
commit71fbeed9f40510e3e0be9322825626a0de352a56 (patch)
tree6a5f8f83335eac2562dd7a16da0ce0eebd236bd8 /Rakefile
parent6ced5f1d985d47d49f39b7af10e01c295eefc2a9 (diff)
parentb16b493f2175f86c9ba32a6a4038fcb75491777b (diff)
downloadchef-71fbeed9f40510e3e0be9322825626a0de352a56.tar.gz
Merge branch 'CHEF-656' of git://github.com/danielsdeleo/chef
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile28
1 files changed, 27 insertions, 1 deletions
diff --git a/Rakefile b/Rakefile
index e6030df651..d9bad16e15 100644
--- a/Rakefile
+++ b/Rakefile
@@ -51,6 +51,30 @@ def start_rabbitmq(type="normal")
end
end
+def configure_rabbitmq(type="normal")
+ # hack. wait for rabbit to come up.
+ sleep 2
+
+ puts `rabbitmqctl add_vhost /nanite`
+
+ # create 'mapper' and 'nanite' users, give them each the password 'testing'
+ %w[mapper nanite].each do |agent|
+ puts `rabbitmqctl add_user #{agent} testing`
+ end
+
+ # grant the mapper user the ability to do anything with the /nanite vhost
+ # the three regex's map to config, write, read permissions respectively
+ puts `rabbitmqctl set_permissions -p /nanite mapper ".*" ".*" ".*"`
+
+ # grant the nanite user more limited permissions on the /nanite vhost
+ puts `rabbitmqctl set_permissions -p /nanite nanite ".*" ".*" ".*"`
+
+ puts `rabbitmqctl list_users`
+ puts `rabbitmqctl list_vhosts`
+ puts `rabbitmqctl list_permissions -p /nanite`
+
+end
+
def start_chef_solr(type="normal")
@chef_solr_pid = nil
cid = fork
@@ -99,6 +123,7 @@ end
def start_dev_environment(type="normal")
start_couchdb(type)
start_rabbitmq(type)
+ configure_rabbitmq(type)
start_chef_solr(type)
start_chef_solr_indexer(type)
start_chef_server(type)
@@ -170,9 +195,10 @@ namespace :dev do
desc "Start RabbitMQ for testing"
task :rabbitmq do
start_rabbitmq("features")
+ configure_rabbitmq("features")
wait_for_ctrlc
end
-
+
desc "Start Chef Solr for testing"
task :chef_solr do
start_chef_solr("features")