Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1881

Switch to using /etc/os-release for OS information if present

    XMLWordPrintable

    Details

    • Story Points:
      13

      Description

      According to this post from the centos announce list http://lists.centos.org/pipermail/centos-announce/2015-April/021010.html

      > Our recommendation for authors of these tools is to consider using the
      > /etc/os-release file as the source of metadata; by design this file is
      > set up to export script consumable content that defines the environment.
      > Furthermore the os-release file can be easily extended to suit site
      > specific requirements.
      >
      > To verify you have the current centos-release file, running 'file
      > /etc/redhat-release' should return '/etc/redhat-release: symbolic link
      > to `centos-release`'

      We should probably check for this file first, so that in future versions we will have the correct information, additionally it was designed for being easily consumable by scripts, so hopefully parsing it will be less error prone.

      When we introduce this parsing to the agent we should reconsider if bundle common inventory_linux from masterfiles provides any valuable information and if it should be deprecated.

      Proposed Variables:
      sys.etc_os_release or sys.os_release as a data container with key=values as parsed from /etc/os-release. it should be tagged with derived_from=/etc/os-release.

      Relevant documentation:
      https://www.freedesktop.org/software/systemd/man/os-release.html

      Note: According to the man page we should check /etc/os-release first and then fall back to /usr/lib/os-release

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                olehermanse Ole Herman Schumacher Elgesem
                Reporter:
                a10042 Nick Anderson
              • Votes:
                1 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel