Skip to content
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

Merged
merged 4 commits into from
Aug 2, 2016

Conversation

stevendanna
Copy link
Contributor

@stevendanna stevendanna commented Aug 1, 2016

With this PR family refers to the distribuion family while name refers to the specific distribution. For example, the family attribute for ubuntu is debian. Further, architecture information is collected for Linux and OS X using uname -m.

This includes possibly breaking changes:

  • The following platforms are now their own family and not listed as part of the redhat family: amazon, fedora.
  • The following platforms are now part of the redhat family whereas before they were their own families: centos oracle scientific enterpriseenterprise xenserver cloudlinux ibm_powerkvm nexus_centos wrlinux
  • The following platforms are now part of the debian family wheras before they were their own families: ubuntu, linuxmint, raspbian
  • opensuse and suse are now part of a single suse family.

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'
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

@chris-rock chris-rock Aug 1, 2016

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.

@chris-rock
Copy link
Contributor

Also see chef/chef#4665 for a discussion around amazon linux

@chris-rock
Copy link
Contributor

fixes inspec/inspec/issues/847

@chris-rock
Copy link
Contributor

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
Copy link
Contributor Author

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.
@@ -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']
Copy link
Contributor

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?

@arlimus
Copy link
Contributor

arlimus commented Aug 2, 2016

Awesome improvements @stevendanna !! 👍

@chris-rock
Copy link
Contributor

Awesome work @stevendanna !

@chris-rock chris-rock merged commit 7a0ddde into master Aug 2, 2016
@chris-rock chris-rock deleted the ssd/family-ohai-sync branch August 2, 2016 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants