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

(FACT-3114) Arch Linux: Implement os version facts #2483

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

bastelfreak
Copy link
Contributor

@bastelfreak bastelfreak commented Apr 22, 2022

From this branch:

$ bundle exec facter os
{
  architecture => "x86_64",
  distro => {
    codename => "n/a",
    description => "Arch Linux",
    id => "Arch",
    release => {
      full => "rolling",
      major => "rolling",
      minor => null
    },
    specification => "n/a"
  },
  family => "Archlinux",
  hardware => "x86_64",
  name => "Archlinux",
  release => {
    full => "6.9.3-arch1-1",
    major => "6",
    minor => "9"
  },
  selinux => {
    enabled => false
  }
}

Facter 3 on Archlinux:

$ facter os
{
  architecture => "x86_64",
  distro => {
    codename => "n/a",
    description => "Arch Linux",
    id => "Arch",
    release => {
      full => "rolling",
      major => "rolling"
    },
    specification => "n/a"
  },
  family => "Archlinux",
  hardware => "x86_64",
  name => "Archlinux",
  release => {
    full => "6.9.3-arch1-1",
    major => "6",
    minor => "9"
  },
  selinux => {
    enabled => false
  }
}

@puppetlabs-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@bastelfreak
Copy link
Contributor Author

please provide some feedback. I'm not sure how to write spec tests for this and I haven't tested this yet on Arch Linux.

@joshcooper
Copy link
Contributor

Facter 4 makes some assumptions that the ID from /etc/os-release maps to the Facter::<ID>::Os::Resolver class, for example. So you'll want to rename your file to lib/facter/facts/arch/os/release.rb and then its call_the_resolver method will automagically be called.

Your implementation will then need to query (something?) to get the OS version.

You may also want to update the fact OS hierarchy code in

OS_HIERARCHY = [
to ensure that osfamily is consistent across facter 3 and 4

@CLAassistant
Copy link

CLAassistant commented Apr 19, 2023

CLA assistant check
All committers have signed the CLA.

@joshcooper
Copy link
Contributor

Hi @bastelfreak please see my last comments about next steps, thanks!

@joshcooper joshcooper added the enhancement New feature or enhancement label Apr 11, 2024
@bastelfreak bastelfreak force-pushed the FACT-3114 branch 6 times, most recently from 1a33a2f to 6657d2f Compare June 20, 2024 18:23
@bastelfreak bastelfreak marked this pull request as ready for review June 20, 2024 18:24
@bastelfreak bastelfreak requested a review from a team as a code owner June 20, 2024 18:24
From this branch:
```
$ bundle exec facter os
{
  architecture => "x86_64",
  distro => {
    codename => "n/a",
    description => "Arch Linux",
    id => "Arch",
    release => {
      full => "rolling",
      major => "rolling",
      minor => null
    },
    specification => "n/a"
  },
  family => "Archlinux",
  hardware => "x86_64",
  name => "Archlinux",
  release => {
    full => "6.9.3-arch1-1",
    major => "6",
    minor => "9"
  },
  selinux => {
    enabled => false
  }
}
```

Facter 3 on Archlinux:
```
$ facter os
{
  architecture => "x86_64",
  distro => {
    codename => "n/a",
    description => "Arch Linux",
    id => "Arch",
    release => {
      full => "rolling",
      major => "rolling"
    },
    specification => "n/a"
  },
  family => "Archlinux",
  hardware => "x86_64",
  name => "Archlinux",
  release => {
    full => "6.9.3-arch1-1",
    major => "6",
    minor => "9"
  },
  selinux => {
    enabled => false
  }
}
```
@joshcooper joshcooper merged commit 3ccc831 into puppetlabs:main Jun 20, 2024
18 checks passed
@bastelfreak bastelfreak deleted the FACT-3114 branch June 20, 2024 19:08
@bastelfreak
Copy link
Contributor Author

thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants