Skip to content

Commit

Permalink
member section is deprecated in favor of nodelist
Browse files Browse the repository at this point in the history
With recent release of corosync, it is recommended to migrate config
file to nodelist because member section is deprecated.

bindnetaddr might also conflicts with nodelist, so we remove bindnetaddr
if nodelist exists.

We rely on the value of set_votequorum to remove member section and
bindnetaddr from corosync.conf. This parameter is tied to quorum_members
in the corosync class.

spec: swap bindnetaddr and ringnumber in corosync.conf

Fix voxpupuli#421 and voxpupuli#422
  • Loading branch information
btravouillon committed Jan 7, 2018
1 parent 6e1234c commit 36ea018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/classes/corosync_spec.rb
Expand Up @@ -275,7 +275,7 @@

it 'configures the ring properly' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{interface.*memberaddr: 10\.0\.0\.1.*memberaddr: 10\.0\.0\.2.*ringnumber:\s+0.*bindnetaddr: 10\.0\.0\.1}m
%r{interface.*memberaddr: 10\.0\.0\.1.*memberaddr: 10\.0\.0\.2.*bindnetaddr: 10\.0\.0\.1.*ringnumber:\s+0}m
)
end
end
Expand All @@ -298,7 +298,7 @@

it 'configures the rings properly' do
is_expected.to contain_file('/etc/corosync/corosync.conf').with_content(
%r{interface.*memberaddr: 10\.0\.0\.1.*memberaddr: 10\.0\.0\.2.*ringnumber:\s+0.*bindnetaddr: 10\.0\.0\.1.*interface.*memberaddr: 10\.0\.1\.1.*memberaddr: 10\.0\.1\.2.*ringnumber:\s+1.*bindnetaddr: 10\.0\.1\.1}m
%r{interface.*memberaddr: 10\.0\.0\.1.*memberaddr: 10\.0\.0\.2.*bindnetaddr: 10\.0\.0\.1.*ringnumber:\s+0.*interface.*memberaddr: 10\.0\.1\.1.*memberaddr: 10\.0\.1\.2.*bindnetaddr: 10\.0\.1\.1.*ringnumber:\s+1}m
)
end
end
Expand Down
4 changes: 3 additions & 1 deletion templates/corosync.conf.erb
Expand Up @@ -45,13 +45,15 @@ totem {
transport: udpu
<% Array(@unicast_addresses.first).each_index do |interface| -%>
interface {
<% if not @set_votequorum -%>
<% Array(Array(@unicast_addresses.map{|x| Array(x).flatten}).transpose[interface]).each do |addr| -%>
member {
memberaddr: <%= addr %>
}
<% end -%>
ringnumber: <%= interface %>
bindnetaddr: <%= Array(@bind_address)[interface] %>
<% end -%>
ringnumber: <%= interface %>
mcastport: <%= Array(@port)[interface] || @port %>
<% if @ttl -%>
ttl: <%= Array(@ttl)[interface] || @ttl %>
Expand Down

0 comments on commit 36ea018

Please sign in to comment.