Skip to content

Commit

Permalink
Allow multiple balancermembers with the same url
Browse files Browse the repository at this point in the history
Currently you can't set multiple balancermembers with the same url even
if they are bind to different balancers.

This commit fixes that unwanted behaviour.
  • Loading branch information
roidelapluie committed Aug 28, 2014
1 parent 06974f7 commit 4a8b692
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifests/balancermember.pp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
$options = [],
) {

concat::fragment { "BalancerMember ${url}":
concat::fragment { "BalancerMember ${name}":
ensure => present,
target => "${::apache::params::confd_dir}/balancer_${balancer_cluster}.conf",
content => inline_template(" BalancerMember ${url} <%= @options.join ' ' %>\n"),
Expand Down
36 changes: 36 additions & 0 deletions spec/defines/balancermember_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require 'spec_helper'

describe 'apache::balancermember', :type => :define do
let :pre_condition do
'include apache
apache::balancer {"balancer":}
apache::balancer {"balancer-external":}
apache::balancermember {"http://127.0.0.1:8080-external": url => "http://127.0.0.1:8080/", balancer_cluster => "balancer-external"}
'
end
let :title do
'http://127.0.0.1:8080/'
end
let :params do
{
:options => [],
:url => 'http://127.0.0.1:8080/',
:balancer_cluster => 'balancer-internal'
}
end
let :facts do
{
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6',
:lsbdistcodename => 'squeeze',
:id => 'root',
:concat_basedir => '/dne',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
:kernel => 'Linux',
}
end
describe "allows multiple balancermembers with the same url" do
it { should contain_concat__fragment('BalancerMember http://127.0.0.1:8080/') }
end
end

0 comments on commit 4a8b692

Please sign in to comment.