Useful for unsupported distributions based on supported distributions
An example use case is we utilize CloudLinux for a handful of servers, a commercial distribution based on RHEL. Since CloudLinux isn't supported by OpenNebula officially, it breaks some context functions, such as the network, due to how OS detection works.
This change proposes the detect_os function used to determine which OS it's the script is being run on and also sends along the ID_LIKE variable in the /etc/os-release file if it exists. Then we can loop over the ID_LIKE distributions to see if anything matches if the ID field doesn't match a supported OS.
No other context scripts rely on the detect_os helper function, so it should be safe to adjust what it returns without breaking other context scripts.
An example use case is we utilize CloudLinux for a handful of servers, a commercial distribution based on RHEL. Since CloudLinux isn't supported by OpenNebula officially, it breaks some context functions, such as the network, due to how OS detection works.
This change proposes the
detect_os
function used to determine which OS it's the script is being run on and also sends along theID_LIKE
variable in the/etc/os-release
file if it exists. Then we can loop over theID_LIKE
distributions to see if anything matches if theID
field doesn't match a supported OS.No other context scripts rely on the
detect_os
helper function, so it should be safe to adjust what it returns without breaking other context scripts.