添加用厨师安装rabbitmq的用户

时间:2016-01-05 17:35:06

标签: rabbitmq chef

使用管理插件成功安装了rabbitmq服务器:

  version = '4.5.1'
  run_list = [ "recipe[rabbitmq::default@#{version}]",
               "recipe[rabbitmq::mgmt_console@#{version}]",
               "recipe[rabbitmq::user_management@#{version}]"]

属性:

default['rabbitmq']['enabled_users'] =
  [{ :name => 'guest', :password => 'guest', :rights =>
    [{ :vhost => nil, :conf => '.*', :write => '.*', :read => '.*' }]
  },
   { :name => 'fake_user', :password => 'fake_user', :tag => 'administrator', :rights =>
       [{ :vhost => nil, :conf => '.*', :write => '.*', :read => '.*' }]
   }]
default['rabbitmq']['disabled_users'] = []


default['rabbitmq']['loopback_users'] = ['fake_user']

在/etc/rabbitmq/rabbitmq.config文件{loopback_users, [<<"fake_user">>]},

中验证了它

用户已安装,但我无法登录管理控制台,无法使用凭据访问它。

甚至通过控制台尝试:

rabbitmqctl delete_user fake_user
rabbitmqctl add_user fake_user fake_user
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / fake_user ".*" ".*" ".*"

enter image description here

1 个答案:

答案 0 :(得分:2)

如果您将fake_user放在loopback_users中,则只能在本地进行身份验证,而不是从管理界面进行身份验证。

尝试使用此选项以允许远程验证:

default['rabbitmq']['loopback_users'] = []