The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #10271

Amazon Linux operatingsytem and operatingsystemrelease and osfamily facts do not work

Added by Dan Bode over 2 years ago. Updated over 2 years ago.

Status:ClosedStart date:10/25/2011
Priority:NormalDue date:
Assignee:Marcus Ferreira% Done:

100%

Category:libraryEstimated time:1.00 hour
Target version:1.6.5
Keywords:amazonlinux Affected Facter version:1.6.4
Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

I am using the latest AMI (ami-7f418316) for Amazon Linux and it has no /etc/redhat-release

In the documentation (http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?LinuxAMIUserGuide.html)

it states that /etc/system-release should be used to determine current release:

Amazon linux AMIs contain a /etc/system-release file that specifies the current release that is installed. This file is updated through yum and is part of the system-release rpm.

Following is an example of /etc/system-release file:

# cat /etc/system-release
Amazon Linux AMI release 2011.09
      

An Amazon Linux AMI also contains a machine readable version of the /etc/system-release file found in /etc/system-release-cpe and follows the CPE specification from MITRE (CPE).
# cat /etc/system-release
Amazon Linux AMI release 2011.09

It looks like release version is 2011.09, I am not sure how to map that to rhel5/rhel6

History

#1 Updated by Dan Bode over 2 years ago

  • Status changed from Unreviewed to Accepted
  • Assignee set to Dan Bode

#2 Updated by Ken Barber over 2 years ago

  • Subject changed from CloudLinux operationsytem and operatingsystemversion and osfamily facts do not work to Amazon Linux operatingsytem and operatingsystemversion and osfamily facts do not work

I presume this is for Amazon Linux not CloudLinux?

Looks like the usage of lsb tools was not the correct path:

https://github.com/puppetlabs/facter/commit/9101e466a2119308db73c334f103a66157d9cf7b#diff-0

Its my fault – I should have known this. I presume when you get lsb tools on the box it works – but its another dependency.

#3 Updated by Dan Bode over 2 years ago

correct, this is amazon linux. lsb tools are not installed by default on Amazon Linux.

#4 Updated by Nigel Kersten over 2 years ago

  • Keywords set to amazonlinux

#5 Updated by Garrett Honeycutt over 2 years ago

Reminder to update puppetlabs-ntp module when this is sorted out.

https://github.com/puppetlabs/puppetlabs-ntp/pull/4#issuecomment-2700043

#6 Updated by Ken Barber over 2 years ago

  • Category set to library
  • Target version set to 144
  • Affected Facter version set to 1.6.3

#7 Updated by Dan Bode over 2 years ago

  • Assignee changed from Dan Bode to Adrien Thebo

#8 Updated by Marcus Ferreira over 2 years ago

  • Status changed from Accepted to Needs Decision
  • % Done changed from 0 to 100
  • Estimated time set to 1.00
  • Affected Facter version changed from 1.6.3 to 1.6.4

Hello,

On github I made a pull request with a fix for this issue:

https://github.com/puppetlabs/facter/pull/129
https://github.com/mv/facter/commit/4c10731575abd249d0914260f351225bc4cfadde

I tested it and is working fine in my instances of Amazon Linux 2011.09.

I hope it can be useful.

Marcus

#9 Updated by Ken Barber over 2 years ago

  • Status changed from Needs Decision to In Topic Branch Pending Review

#10 Updated by Ken Barber over 2 years ago

Looks good on a cursory glance but worried about backwards compatibility to older version of Amazon Linux – comments in pull request. I closed the pull request as you should raise it against 1.6.x.

#11 Updated by Ken Barber over 2 years ago

  • Subject changed from Amazon Linux operatingsytem and operatingsystemversion and osfamily facts do not work to Amazon Linux operatingsytem and operatingsystemrelease and osfamily facts do not work
  • Assignee changed from Adrien Thebo to Marcus Ferreira

Hey marcus – the patch looks great. So the ticket also covers the operatingsystemrelease fact, which at the moment is using lsb. It would be awesome if you could solve that as well :–).

#12 Updated by Daniel Pittman over 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version changed from 144 to 1.6.5

Ken Barber wrote:

Hey marcus – the patch looks great. So the ticket also covers the operatingsystemrelease fact, which at the moment is using lsb. It would be awesome if you could solve that as well :–).

I merged the code, because while it would be great to get the extra change, it doesn’t seem necessary to delay this code waiting for a convenient but not directly blocking change.

#13 Updated by Matthaus Owens over 2 years ago

  • Status changed from Merged - Pending Release to Closed

Released in 1.6.5rc1

Also available in: Atom PDF