train should be using /etc/os-release for all Linux os detection
Linux long ago moved to using /etc/os-release for all operating system information. We moved Chef to this several years ago with Ohai and it's been a great success. We no longer have to add every new operating system as they're released and instead we just use the OS data that comes from /etc/os-release automatically. For our legacy platform names we do a simple remap and for everything new we just use the value out of /etc/os-release. Train should be using this same logic so we can settle on a single detection path and so we don't have to add every new distro to train:
https://github.com/chef/ohai/blob/master/lib/ohai/plugins/linux/platform.rb
Here's a list of all the files and commands we're running to check the OS. This is pointless and slow
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = uname -s
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = uname -m
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/debian_version
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/os-release && cat /etc/os-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /usr/bin/FastCli
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = show version | json
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/lsb-release && cat /etc/lsb-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /usr/bin/lsb-release && cat /usr/bin/lsb-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/oracle-release && cat /etc/oracle-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/enterprise-release && cat /etc/enterprise-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/parallels-release && cat /etc/parallels-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/system-release && cat /etc/system-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/redhat-release && cat /etc/redhat-release
[2021-10-08T11:46:25-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/SuSE-release && cat /etc/SuSE-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/arch-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/slackware-version && cat /etc/slackware-version
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/gentoo-release && cat /etc/gentoo-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/exherbo-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/alpine-release && cat /etc/alpine-release
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/coreos/update.conf
[2021-10-08T11:46:26-07:00] DEBUG: [SSH] [email protected] cmd = test -f /etc/issue && cat /etc/issue