Skip to content

Commit

Permalink
Merge pull request #841 from jeckersb/no-server-erl-args
Browse files Browse the repository at this point in the history
Don't use RABBITMQ_SERVER_ERL_ARGS
  • Loading branch information
ekohl committed Jun 23, 2020
2 parents 77b0033 + ae3f8f2 commit 71a0631
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion manifests/config.pp
Expand Up @@ -125,7 +125,7 @@
$proto_dist = 'inet6_tcp'
$ssl_path = ''
}
$ipv6_or_tls_env = ['SERVER', 'CTL'].reduce({}) |$memo, $item| {
$ipv6_or_tls_env = ['SERVER_ADDITIONAL', 'CTL'].reduce({}) |$memo, $item| {
$orig = $_environment_variables["RABBITMQ_${item}_ERL_ARGS"]
$munged = $orig ? {
# already quoted, keep quoting
Expand Down
20 changes: 10 additions & 10 deletions spec/classes/rabbitmq_spec.rb
Expand Up @@ -1326,35 +1326,35 @@
context 'without other erl args' do
it 'enables inet6 distribution' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS="-proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="-proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS="-proto_dist inet6_tcp"$})
end
end

context 'with other quoted erl args' do
let(:params) do
{ ipv6: true,
environment_variables: { 'RABBITMQ_SERVER_ERL_ARGS' => '"some quoted args"',
environment_variables: { 'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS' => '"some quoted args"',
'RABBITMQ_CTL_ERL_ARGS' => '"other quoted args"' } }
end

it 'enables inet6 distribution and quote properly' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS="some quoted args -proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="some quoted args -proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS="other quoted args -proto_dist inet6_tcp"$})
end
end

context 'with other unquoted erl args' do
let(:params) do
{ ipv6: true,
environment_variables: { 'RABBITMQ_SERVER_ERL_ARGS' => 'foo',
environment_variables: { 'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS' => 'foo',
'RABBITMQ_CTL_ERL_ARGS' => 'bar' } }
end

it 'enables inet6 distribution and quote properly' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS="foo -proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="foo -proto_dist inet6_tcp"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS="bar -proto_dist inet6_tcp"$})
end
end
Expand All @@ -1367,7 +1367,7 @@

it 'enables inet6 distribution' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS=" -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS=" -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS=" -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$})
end
end
Expand All @@ -1376,13 +1376,13 @@
let(:params) do
{ ipv6: true,
ssl_erl_dist: true,
environment_variables: { 'RABBITMQ_SERVER_ERL_ARGS' => '"some quoted args"',
environment_variables: { 'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS' => '"some quoted args"',
'RABBITMQ_CTL_ERL_ARGS' => '"other quoted args"' } }
end

it 'enables inet6 distribution and quote properly' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS="some quoted args -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="some quoted args -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS="other quoted args -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$})
end
end
Expand All @@ -1391,13 +1391,13 @@
let(:params) do
{ ipv6: true,
ssl_erl_dist: true,
environment_variables: { 'RABBITMQ_SERVER_ERL_ARGS' => 'foo',
environment_variables: { 'RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS' => 'foo',
'RABBITMQ_CTL_ERL_ARGS' => 'bar' } }
end

it 'enables inet6 distribution and quote properly' do
is_expected.to contain_file('rabbitmq-env.config'). \
with_content(%r{^RABBITMQ_SERVER_ERL_ARGS="foo -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="foo -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$}). \
with_content(%r{^RABBITMQ_CTL_ERL_ARGS="bar -pa /usr/lib64/erlang/lib/ssl-7.3.3.1/ebin -proto_dist inet6_tls"$})
end
end
Expand Down

0 comments on commit 71a0631

Please sign in to comment.