chef/cookbooks/rabbitmq/templates/default/definitions.json.erb
{
"vhosts": [
{
"name": "/"
},
<% if @trove_enabled -%>
{
"name": <%= @json_trove_vhost %>
},
<% end -%>
{
"name": <%= @json_vhost %>
}
],
<% if @ha_all_policy -%>
"policies": [
{
"apply-to": "queues",
"definition": <%= @json_policy_definition %>,
"name": "ha-queues",
"pattern": "<%= @queue_regex %>",
"priority": 0,
"vhost": <%= @json_vhost %>
}
],
<% end -%>
"users": [
<% if @trove_enabled -%>
{
"name": <%= @json_trove_user %>,
"password": <%= @json_trove_password %>,
"tags": ""
},
<% end -%>
<% @extra_users.each do |user| -%>
{
"name": "<%= user[:username] %>",
"password": "<%= user[:password] %>",
"tags": "<%= user[:tags].join(',') %>"
},
<% end -%>
{
"name": <%= @json_user %>,
"password": <%= @json_password %>,
"tags": "management"
}
],
"permissions": [
<% if @trove_enabled -%>
{
"user": <%= @json_trove_user %>,
"vhost": <%= @json_trove_vhost %>,
"configure": ".*",
"read": ".*",
"write": ".*"
},
<% end -%>
<% @extra_users.each do |user| -%>
{
"user": "<%= user[:username] %>",
"vhost": <%= @json_vhost %>,
"configure": "<%= user[:permissions][0] %>",
"read": "<%= user[:permissions][2] %>",
"write": "<%= user[:permissions][1] %>"
},
<% end -%>
{
"user": <%= @json_user %>,
"vhost": <%= @json_vhost %>,
"configure": ".*",
"read": ".*",
"write": ".*"
}
]
}