Default hostgroup plugin question

I'm trying to get the default hostgroup plugin working, but I have a couple
questions. first being when does it process the hostgroup rules (is it only
after a host checks in)? Second I'm trying to set the hostgroup by
installed OS. right now my default-hostgroup.yaml file looks like this:

··· --- :default_hostgroup: :facts_map: "Centos7/Thin": "productname": "HP t420 Thin Client" "operatingsystem": "CentOS" "Centos7/Thin": "productname": "200-010" "operatingsystem": "CentOS" "Centos7": "operatingsystem": "CentOS"

Right now it doesn’t seem to be doing anything. It doesn’t seem to even
want to match the last condition either. Any thoughts?

I've figured out what was up. restarting foreman (per the documentation
apparently means restarting httpd. :slight_smile: One last question though, I noticed
the group assignment when more than one fact was involved was a little
random. For example:

  "productname": "HP t420 Thin Client"
  "operatingsystem": "CentOS"

would sometimes get the Centos7/thin hostgroup and sometimes it would just
assign the Centos7 group. what is the correct way to declare a logical AND
with more than one fact?

It's not explicitly documented, but the OR nature of the fact groups is
explicitly coded (see


if you like reading Ruby). There's an open PR on this which I've been
meaning to get to for ages (
https://github.com/theforeman/foreman_default_hostgroup/pull/22) which goes
along this line - you could try it if you're feeling adventurous :slight_smile:

Greg

··· On 11 November 2016 at 18:09, Mike Tupker wrote:

what is the correct way to declare a logical AND with more than one fact?