centreon / centreon-ha

Apache License 2.0
1 stars 1 forks source link

Ps 34 manual ha #59

Open cedricmeschin opened 2 years ago

cedricmeschin commented 2 years ago

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 effect nmcli 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 effect nmcli connection up @CENTRAL_VIP_IFNAME@

This also prevents VIP up in slave node.

Checklist

Community contributors & Centreon team

sonarqube-decoration[bot] commented 2 years ago

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqube-decoration[bot] commented 2 years ago

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqube-decoration[bot] commented 1 year ago

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication