Open cedricmeschin opened 2 years ago
SonarQube Quality Gate
0 Bugs
0 Vulnerabilities
0 Security Hotspots
13 Code Smells
No Coverage information
0.0% Duplication
SonarQube Quality Gate
0 Bugs
0 Vulnerabilities
0 Security Hotspots
13 Code Smells
No Coverage information
0.0% Duplication
SonarQube Quality Gate
0 Bugs
0 Vulnerabilities
0 Security Hotspots
13 Code Smells
No Coverage information
0.0% Duplication
Description
On recent OS (RHEL8 for example), the declaration of a VIP over if-cfg-@VIP_IF_NAME@:1 file is no working anymore, we can't enable or disable VIP with ifup and ifdown command, Interface name isn't recognized. So we can use "nmcli" command who works on the different OS (RHEL8, CentOS7, OL8, etc...) It's needed with documentation of centreon-ha in 21.10 https://github.com/centreon/centreon-documentation/pull/1585
Type of change
Target serie
How this pull request can be tested ?
In replacement of ifup and ifdown commands after declaration of "VIP_IF_NAME:1" We use nmcli commands for more compatibilities in recent OS (for ex on RHEL 8, "VIP_IF_NAME:1" is no more functionnal)
to add a VIP:
nmcli con mod "@CENTRAL_VIP_IFNAME@" +ipv4.addresses "@CENTRAL_VIP_IPADDR@/@CENTRAL_VIP_CIDR_NETMASK@"
and to take effectnmcli connection up @CENTRAL_VIP_IFNAME@
to remove a VIP:
nmcli con mod "@CENTRAL_VIP_IFNAME@" -ipv4.addresses "@CENTRAL_VIP_IPADDR@/@CENTRAL_VIP_CIDR_NETMASK@"
and to take effectnmcli connection up @CENTRAL_VIP_IFNAME@
This also prevents VIP up in slave node.
Checklist
Community contributors & Centreon team