Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add attribute to bind erlang networking to localhost. #46

Merged
merged 2 commits into from
Jul 6, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
default['rabbitmq']['default_user'] = 'guest'
default['rabbitmq']['default_pass'] = 'guest'

# bind erlang networking to localhost
default['rabbitmq']['local_erl_networking'] = false

#clustering
default['rabbitmq']['cluster'] = false
default['rabbitmq']['cluster_disk_nodes'] = []
Expand Down
5 changes: 5 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@
:description => "List all plugins that will be deactivated",
:default => [],
:type => "array"

attribute "rabbitmq/local_erl_networking",
:display_name => "Local Erlang networking",
:description => "Bind erlang networking to localhost"

5 changes: 5 additions & 0 deletions templates/default/rabbitmq-env.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# Generated by Chef
###

<% if node['rabbitmq']['local_erl_networking'] -%>
NODENAME=rabbit@localhost
export ERL_EPMD_ADDRESS=127.0.0.1
<% else %>
<% if node['rabbitmq']['nodename'] -%>NODENAME=<%= node['rabbitmq']['nodename'] %><% end %>
<% end %>
<% if node['rabbitmq']['address'] -%>NODE_IP_ADDRESS=<%= node['rabbitmq']['address'] %><% end %>
<% if node['rabbitmq']['port'] -%>NODE_PORT=<%= node['rabbitmq']['port'] %><% end %>
<% if node['rabbitmq']['config'] -%>CONFIG_FILE=<%= node['rabbitmq']['config'] %><% end %>
Expand Down
3 changes: 3 additions & 0 deletions templates/default/rabbitmq.config.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
%%%

[
<% if node['rabbitmq']['local_erl_networking'] %>
{kernel, [{inet_dist_use_interface,{127,0,0,1}}]},
<% end %>
{rabbit, [
<% if node['rabbitmq']['cluster'] && node['rabbitmq']['cluster_disk_nodes'] -%>
{cluster_nodes, [<%= node['rabbitmq']['cluster_disk_nodes'].map{|n| "\'#{n}\'"}.join(',') %>]},
Expand Down