"Specify Matchers" on OS

Problem:
Since we want to use the openscap module, we need to define “specify matchers” based on the dropdown value of “os” for the package_name variable.
Ive tried different variations of this but im not able to make it match on anything using the “os”.
What ive tried:
“Debian”, “Debian*”, “Debian 11”, “Debian 11.3”

I find the documentation to be a bit sparse on this subject (The links in docs doesnt even work, and the button in foreman likewise doesnt work, it points to the wrong sub chapter (https://puppet.example.net/links/manual/4.2.6SmartMatchers but it should be 4.2.5SmartMatchers).
Documentation has a single example showing the Attribute type of “environment” and stating that its matching on string equality only. This is fine, but i dont know what the “OS” type is based on.

As a side note im also wondering if i can use custom facts to match here? I saw some reference to this somewhere, but i dont understand how that would work since we are locked to using the dropdown…
Expected outcome:
I set the value to “Debian 11.3” and it should match as this is what is listed as “OS” on the host in foreman.
Foreman and Proxy versions:
3.10
Foreman and Proxy plugin versions:
N/A
Distribution and version:
Rhel 8.9
Other relevant data:
I have checked facts on client:

# /opt/puppetlabs/puppet/bin/facter os
{
  architecture => "amd64",
  distro => {
    codename => "bullseye",
    description => "Debian GNU/Linux 11 (bullseye)",
    id => "Debian",
    release => {
      full => "11.3",
      major => "11",
      minor => "3"
    }
  },
  family => "Debian",
  hardware => "x86_64",
  name => "Debian",
  release => {
    full => "11.3",
    major => "11",
    minor => "3"
  },
  selinux => {
    enabled => false
  }
}

not a complete answer to your question, but to add matchers for any fact you want:
In the “Order” box above, simply add whatever you want, it gets added to the dropdown:

1 Like

I see, thats nice!

Ok i’ve done more testing today and i got it to work.

I dont know why it did not work yesterday, im sure i tried to set the value to both “Debian 11.3” including the double apostrophes and excluding them.

When i did more testing today using custom facts (thanks @birkirf ) i also added a test for Debian 11.3 again, without the apostrophes, and it works…

Below is the output of puppet agent run:
(Disregard the facter error, thats a bug im experiencing with a fact added by katello (i think))

# /opt/puppetlabs/puppet/bin/puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Facter: Error while resolving custom fact fact='rh_certificate', resolution='<anonymous>': break from proc-closure
Notice: Requesting catalog from puppet.example.net:8140 (10.10.253.113)
Notice: Catalog compiled by puppet.ncop.net
Info: Caching catalog for deb11-c01.example.net
Info: Applying configuration version '1732111577'
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install ruby-foreman-scap-client2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package ruby-foreman-scap-client2

And the actual settings used:

Regardless of my confusion i think this is resolved, and it works exactly like described in the docs…