Skip to content

Commit

Permalink
add the ability to load definitions on start
Browse files Browse the repository at this point in the history
  • Loading branch information
esabelhaus committed Jan 17, 2018
1 parent 58c0331 commit 5e25ef4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,16 @@ By default, the guest user can only connect via localhost. This is the behavior

If you wish to allow the default guest user to connect remotely, you can change this to `[]`. If instead you wanted to allow just the user 'foo' to connect over loopback, you would set this value to `["foo"]`. More information can be found here: https://www.rabbitmq.com/access-control.html.

##### Load definitions
The RabbitMQ Management Plugin provides a means to load predefined definitions for your installation. This feature allows for the application to consume a JSON file on startup to ensure that the configuration matches your exact specifications. This can be enabled by specifying the following attribute:

`['rabbitmq']['management']['load_definitions'] = true`

By default, the service will expect a JSON file to exist at `/etc/rabbitmq/load_definitions.json`; however, you can define another path if you'd prefer using the following attribute:

`['rabbitmq']['management']['definitions_file'] = '/path/to/your/definitions.json'`

In order to use this functionality, you will need to produce whatever file is defined by the above attribute with your definitions before you execute the RabbitMQ cookbook itself.

### mgmt_console
Installs the `rabbitmq_management` and `rabbitmq_management_visualiser` plugins.
Expand Down
4 changes: 4 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@
default['rabbitmq']['web_console_ssl'] = false
default['rabbitmq']['web_console_ssl_port'] = 15_671

# If configured to true, allows downstream cookbooks to supply definitions on start
default['rabbitmq']['management']['load_definitions'] = false
default['rabbitmq']['management']['definitions_file'] = '/etc/rabbitmq/load_definitions.json'

# Change non SSL web console listen port
default['rabbitmq']['web_console_port'] = 15672

Expand Down
4 changes: 4 additions & 0 deletions templates/default/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
]},
<% if node['rabbitmq']['web_console_ssl'] -%>
{rabbitmq_management, [
<% if node['rabbitmq']['management']['load_definitions'] %>
{load_definitions, "<%= node['rabbitmq']['management']['definitions_file'] %>"}
]}
<% end -%>
{listener, [{port, <%= node['rabbitmq']['web_console_ssl_port'] %>},
<% if node['rabbitmq']['web_console_interface'] -%>
{ip, "<%= node['rabbitmq']['web_console_interface'] %>"},
Expand Down

0 comments on commit 5e25ef4

Please sign in to comment.