voxpupuli/puppet-corosync

Cannot avoid the `bindnetaddr` to be set into `/etc/corosync/corosync.conf` file

Closed this issue · 2 comments

cedef commented

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: All
  • Ruby: All
  • Distribution: CentOS 7
  • Module version: 5.1.0

How to reproduce

class { 'corosync':
  authkey           => '/etc/pki/tls/certs/ca-bundle.crt',
  bind_address      => undef,
  unicast_addresses => [
    ['node1_lan', 'node1_btb'],
    ['node2_lan', 'node2_btb'],
  ],
  set_votequorum    => true,
  quorum_members    => [
    ['node1_lan', 'node1_btb'],
    ['node2_lan', 'node2_btb'],
  ],
  cluster_name      => 'cluster_rp',
  enable_secauth    => true,
  rrp_mode          => 'active',
}

What are you seeing

This puppet code results into the following /etc/corosync/corosync.conf snippet:

totem {
...
  interface {
    member {
      memberaddr: node1_lan
    }
    member {
      memberaddr: node2_lan
    }
    ringnumber:  0
    bindnetaddr: 192.168.121.125   # Default value applied => $::ipaddress
    mcastport:   5405
  }
  interface {
    member {
      memberaddr: node1_btb
    }
    member {
      memberaddr: node2_btb
    }
    ringnumber:  1
    bindnetaddr:  # PROBLEM HERE !!
    mcastport:   5405
  }
}

What behaviour did you expect instead

I would expect the bindnetaddr directive to be absent: when absent, corosync daemon behaviour is to bind on all interface where a ring is declared.

Any additional information you'd like to impart

I could attach a patch, would you agreed that either bind_address => undef or bind_address => 'UNSET' would result in no bindnetaddr directive.

Hi @cedef ,

Obviously there is an issue in the corosync.conf file since bindnetaddr is empty for the second interface. Looking at corosync.conf(5), it looks like using $::ipaddress is wrong also.

However, the interface.bindnetaddr is one of the four parameters required, thus I don't believe we can make it an optional parameter.

I will give a deeper look.

Regards,

Looking at corosync.conf(5), it looks like using $::ipaddress is wrong also.

I was looking at https://linux.die.net/man/5/corosync.conf which seems to be an old manpage.

bindnetaddr
This specifies the network address the corosync executive should bind to. For example, if the local interface is 192.168.5.92 with netmask 255.255.255.0, set bindnetaddr to 192.168.5.0. If the local interface is 192.168.5.92 with netmask 255.255.255.192, set bindnetaddr to 192.168.5.64, and so forth.

In the corosync.conf(5) delivered with el7, the use of $::ipaddress is allowed.

bindnetaddr
This specifies the network address the corosync executive should bind to.
bindnetaddr should be an IP address configured on the system, or a network address.