Sha256: b7b2bc67ab4de0813cb97dd00335beb56a5313b5e6966ea47e8cbbbd2c5b062a

Contents?: true

Size: 1.14 KB

Versions: 10

Compression:

Stored size: 1.14 KB

Contents

#!/usr/bin/env ruby

$nodename = ENV.fetch("RABBITMQ_NODENAME", "rabbit")
$ctl      = ENV.fetch("RABBITMQCTL",       "sudo rabbitmqctl")
$plugins  = ENV.fetch("RABBITMQ_PLUGINS",  "sudo rabbitmq-plugins")

def rabbit_control(args)
  command = "#{$ctl} -n #{$nodename} #{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

10 entries across 10 versions & 1 rubygems

Version Path
bunny-2.2.2 bin/ci/before_build
bunny-2.2.1 bin/ci/before_build
bunny-2.2.0 bin/ci/before_build
bunny-1.7.1 bin/ci/before_build
bunny-2.1.0 bin/ci/before_build
bunny-2.0.1 bin/ci/before_build
bunny-2.0.0 bin/ci/before_build
bunny-2.0.0.rc2 bin/ci/before_build
bunny-2.0.0.rc1 bin/ci/before_build
bunny-1.7.0 bin/ci/before_build