totem {
  version:                             2
  token:                               3000
  token_retransmits_before_loss_const: 10
  join:                                60
  consensus:                           3600
  vsftype:                             none
  max_messages:                        20
  clear_node_high_bit:                 yes
  rrp_mode:                            none
  secauth:                             <%= enable_secauth %>
  threads:                             <%= threads %>
  transport:                           udpu
  interface {
<% unicast_addresses.each do |hostname,addr| -%>
    member {
      memberaddr: <%= addr %>
    }
<% end -%>
    ringnumber:  0
    bindnetaddr: <%= bind_address %>
    mcastport:   <%= port %>
  }
}

logging {
  fileline:        off
  to_stderr:       no 
  to_logfile:      no
  to_syslog:       yes
  logfile:         /var/log/corosync.log
  syslog_facility: daemon
# We don't really want corosync debugs, it is TOO verbose
#  debug:           <%= scope.lookupvar('debug') ? 'on' : 'off' %>
  debug:           off
  timestamp:       on
  logger_subsys {
    subsys: AMF
    debug:  off
    tags:   enter|leave|trace1|trace2|trace3|trace4|trace6
  }
}

amf {
  mode: disabled
}

aisexec {
  user:  root
  group: root
}

totem {
  version:                             2
  token:                               3000
  token_retransmits_before_loss_const: 10
  join:                                60
  consensus:                           3600
  vsftype:                             none
  max_messages:                        20
  clear_node_high_bit:                 yes
  rrp_mode:                            none
  secauth:                             <%= enable_secauth %>
  threads:                             <%= threads %>
  transport:                           udpu
  interface {
<% unicast_addresses.sort.each do |hostname,addr| -%>
    member {
      memberaddr: <%= addr %>
    }
<% end -%>
    ringnumber:  0
    bindnetaddr: <%= bind_address %>
    mcastport:   <%= port %>
  }
}

logging {
  fileline:        off
  to_stderr:       no 
  to_logfile:      no
  to_syslog:       yes
  logfile:         /var/log/corosync.log
  syslog_facility: daemon
# We don't really want corosync debugs, it is TOO verbose
#  debug:           <%= scope.lookupvar('debug') ? 'on' : 'off' %>
  debug:           off
  timestamp:       on
  logger_subsys {
    subsys: AMF
    debug:  off
    tags:   enter|leave|trace1|trace2|trace3|trace4|trace6
  }
}

amf {
  mode: disabled
}

aisexec {
  user:  root
  group: root
}

Sort unicast corosync IP addresses
Sort unicast corosync IP addresses

Sort addresses in order to make corosync
config file generation idempotent

Change-Id: I02dcd9bb3458b56e23c9b452db12e0e7e334e0f3
