diff --git a/manifests/init.pp b/manifests/init.pp index 5095cf4f..14ab8f5d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -142,6 +142,8 @@ # [*quorum_members*] # Array of quorum member hostname. This is required if set_votequorum # is set to true. +# You can also have an array of arrays to have multiple rings. In that case, +# each subarray matches a member IP addresses. # Defaults to ['localhost'] # # [*quorum_members_ids*] @@ -312,6 +314,14 @@ fail('You must provide a value for multicast_address') } + # $rrp_mode value of 'none' isn't allowed with multiple rings + if ( is_array($multicast_address) and size($multicast_address) > 1 ) + or ( is_array($unicast_addresses) and is_array($unicast_addresses[0]) and size($unicast_addresses[0]) > 1 ) + or ( is_array($quorum_members) and is_array($quorum_members[0]) and size($quorum_members[0]) > 1 ) + and $rrp_mode == 'none' { + fail('You must set rrp_mode to active or passive with multiple rings') + } + case $enable_secauth { true: { $enable_secauth_real = 'on' } false: { $enable_secauth_real = 'off' } diff --git a/templates/corosync.conf.erb b/templates/corosync.conf.erb index 60f17061..ff7c3068 100644 --- a/templates/corosync.conf.erb +++ b/templates/corosync.conf.erb @@ -95,7 +95,9 @@ quorum { nodelist { <% [@quorum_members].flatten.each_index do |i| -%> node { - ring0_addr: <%= [@quorum_members].flatten[i] %> +<% Array(Array(@quorum_members.map{|node| Array(node).flatten})[i]).each_with_index do |addr,ring| -%> + ring<%= ring %>_addr: <%= addr %> +<% end -%> <% if @quorum_members_ids.nil? -%> nodeid: <%= i+1 %> <% else -%> diff --git a/templates/corosync.conf.udpu.erb b/templates/corosync.conf.udpu.erb index 3b5c6cd9..7f6e99e2 100644 --- a/templates/corosync.conf.udpu.erb +++ b/templates/corosync.conf.udpu.erb @@ -96,7 +96,9 @@ quorum { nodelist { <% [@quorum_members].flatten.each_index do |i| -%> node { - ring0_addr: <%= [@quorum_members].flatten[i] %> +<% Array(Array(@quorum_members.map{|node| Array(node).flatten})[i]).each_with_index do |addr,ring| -%> + ring<%= ring %>_addr: <%= addr %> +<% end -%> <% if @quorum_members_ids.nil? -%> nodeid: <%= i+1 %> <% else -%>