-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bring train platform data more in line with ohai's platform data #126
Conversation
Previously the os detection on linux set os[:family] to the name of the distribution and did not set os[:name]. This meant that `os[:family]` for CentOS was `centos` despite most uses expecting it to share the same platform family identifier as other redhat based distributions. Fixes #847 Signed-off-by: Steven Danna <[email protected]>
if DEBIAN_FAMILY.include?(@platform[:name]) | ||
'debian' | ||
elsif RHEL_FAMILY.include?(@platform[:name]) | ||
'rhel' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a reason, why we switch from redhat
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to switch this back. My goal in changing this was to bring it further in line with what ohai
detects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to be compatible with Serverspec here: http://serverspec.org/advanced_tips.html They use redhat.
6575839
to
b79f0f7
Compare
Also see chef/chef#4665 for a discussion around amazon linux |
fixes inspec/inspec/issues/847 |
fixes inspec/inspec/issues/772 |
@@ -12,95 +12,121 @@ | |||
|
|||
module Train::Extras | |||
module DetectLinux # rubocop:disable Metrics/ModuleLength | |||
DEBIAN_FAMILY = %w{debian ubuntu linuxmint raspbian}.freeze | |||
REDHAT_FAMILY = %w{centos redhat oracle scientific enterpriseenterprise amazon xenserver cloudlinux ibm_powerkvm nexus_centos wrlinux}.freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per lamont's comment, we should drop amazon from this array
This includes - `family` refers to the distribuion family while `name` refers to the spcific distribution. For example, the family attribute for ubuntu is `debian`. - The `redhat` family has been renamed `rhel` - Fedora is not listed as a `rhel` platform.
b79f0f7
to
c2b2963
Compare
@@ -66,7 +62,7 @@ def to_hash | |||
}, | |||
} | |||
|
|||
OS['linux'] = %w{linux alpine arch coreos exherbo gentoo slackware} + OS['redhat'] + OS['debian'] + OS['suse'] | |||
OS['linux'] = %w{linux alpine arch coreos exherbo gentoo slackware fedora} + OS['redhat'] + OS['debian'] + OS['suse'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have to add amazon as a platform here?
Signed-off-by: Steven Danna <[email protected]>
Awesome improvements @stevendanna !! 👍 |
Awesome work @stevendanna ! |
With this PR
family
refers to the distribuion family whilename
refers to the specific distribution. For example, the family attribute for ubuntu isdebian
. Further, architecture information is collected for Linux and OS X usinguname -m
.This includes possibly breaking changes:
redhat
family:amazon
,fedora
.redhat
family whereas before they were their own families:centos oracle scientific enterpriseenterprise xenserver cloudlinux ibm_powerkvm nexus_centos wrlinux
debian
family wheras before they were their own families:ubuntu
,linuxmint
,raspbian
opensuse
andsuse
are now part of a singlesuse
family.