Sha256: 317157b2d56a614094fceceae5571639bdf5b47927e53c973ec48f8556a404c9

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

#!/usr/bin/env ruby

$ctl      = ENV.fetch("RABBITMQCTL",       "sudo rabbitmqctl")
$plugins  = ENV.fetch("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

2 entries across 2 versions & 1 rubygems

Version Path
bunny-2.3.1 bin/ci/before_build
bunny-2.3.0 bin/ci/before_build