Sha256: bc01c77b97b9ecb714c25e05c95ef9162a93d59149e07b724d780ab6bb19e9da

Contents?: true

Size: 1.13 KB

Versions: 8

Compression:

Stored size: 1.13 KB

Contents

#!/usr/bin/env ruby

$ctl      = ENV["BUNNY_RABBITMQCTL"]      || ENV["RABBITMQCTL"]      || "sudo rabbitmqctl"
$plugins  = ENV["BUNNY_RABBITMQ_PLUGINS"] || ENV["RABBITMQ_PLUGINS"] || "sudo rabbitmq-plugins"

def rabbit_control(args)
  command = "#{$ctl} #{args}"
  system command
end

def rabbit_plugins(args)
  command = "#{$plugins} #{args}"
  system command
end


# guest:guest has full access to /

rabbit_control 'add_vhost /'
rabbit_control 'add_user guest guest'
rabbit_control 'set_permissions -p / guest ".*" ".*" ".*"'


# bunny_gem:bunny_password has full access to bunny_testbed

rabbit_control 'add_vhost bunny_testbed'
rabbit_control 'add_user bunny_gem bunny_password'
rabbit_control 'set_permissions -p bunny_testbed bunny_gem ".*" ".*" ".*"'


# guest:guest has full access to bunny_testbed

rabbit_control 'set_permissions -p bunny_testbed guest ".*" ".*" ".*"'


# bunny_reader:reader_password has read access to bunny_testbed

rabbit_control 'add_user bunny_reader reader_password'
rabbit_control 'set_permissions -p bunny_testbed bunny_reader "^---$" "^---$" ".*"'

# requires RabbitMQ 3.0+
# rabbit_plugins 'enable rabbitmq_management'

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bunny-2.6.4 bin/ci/before_build
bunny-2.6.3 bin/ci/before_build
bunny-2.6.2 bin/ci/before_build
bunny-2.6.1 bin/ci/before_build
bunny-2.6.0 bin/ci/before_build
bunny-2.5.1 bin/ci/before_build
bunny-2.5.0 bin/ci/before_build
bunny-2.4.0 bin/ci/before_build