diff options
author | Dan DeLeo <danielsdeleo@mac.com> | 2009-10-28 17:28:19 -0600 |
---|---|---|
committer | Dan DeLeo <danielsdeleo@mac.com> | 2009-10-28 17:28:19 -0600 |
commit | b16b493f2175f86c9ba32a6a4038fcb75491777b (patch) | |
tree | ed5638416b7b18c2bcdfb7739f381873562d8840 /Rakefile | |
parent | 62c77204dfa187c974e8c4c236cff3578c8f0f0c (diff) | |
download | chef-b16b493f2175f86c9ba32a6a4038fcb75491777b.tar.gz |
configure rabbitmq for nanite in dev environment
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 28 |
1 files changed, 27 insertions, 1 deletions
@@ -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") |