diff --git a/CHANGELOG.md b/CHANGELOG.md index 6231b241..1800c814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 2016-09-15 - Release 5.0.0 +- Allow multiple rings in nodelist (#262, #291, #336) + # 2016-08-30 - Release 4.0.0 ### Summary - Validate corosync configuration before overwriting (available in EL7, Ubuntu diff --git a/README.md b/README.md index d6a1c277..3cb21347 100644 --- a/README.md +++ b/README.md @@ -68,10 +68,25 @@ class { 'corosync': quorum_members_ids => [ 10, 11, 12 ], } ``` + Note: custom IDs may be required when adding or removing nodes to a cluster on a fly. Then each node shall have an unique and persistent ID. +*To have multiple rings in the nodelist* +```puppet +class { 'corosync': + set_votequorum => true, + quorum_members => [ + ['172.31.110.1', '172.31.111.1'], + ['172.31.110.2', '172.31.111.2'], + ], +} +``` + +When `quorum_members` is an array of arrays, each sub array represents one +host IP addresses. + ### Configuring primitives The resources that Corosync will manage can be referred to as a primitive. diff --git a/spec/classes/corosync_spec.rb b/spec/classes/corosync_spec.rb index 620181a7..7facabcb 100644 --- a/spec/classes/corosync_spec.rb +++ b/spec/classes/corosync_spec.rb @@ -62,6 +62,28 @@ end end + context 'when set_quorum is true and quorum_members are an array of arrays' do + before do + params.merge!( + set_votequorum: true, + quorum_members: [ + ['172.31.10.1', '172.31.11.1', '172.31.12.1'], + ['172.31.10.2', '172.31.11.2', '172.31.12.2'], + ['172.31.10.3', '172.31.11.3', '172.31.12.3'], + ['172.31.10.4', '172.31.11.4', '172.31.12.4'], + ] + ) + end + + (1..4).each do |node_id| + it "configures rings for host #{node_id} correctly" do + should contain_file('/etc/corosync/corosync.conf').with_content( + %r{ring0_addr: 172.31.10.#{node_id}\n\s*ring1_addr: 172.31.11.#{node_id}\n\s*ring2_addr: 172.31.12.#{node_id}\n\s*nodeid: #{node_id}} + ) + end + end + end + context 'when unicast is used' do before do params.merge!(