Dynamically add nodes to a node group

Rules are the most powerful and scalable way to include nodes in a node group. Rules use facts to identify nodes to include in a group.

Rules are based on facts, such as operating system, BIOS version, hardware model, UUID, or time zone. In addition to most core facts, you can also use structured and trusted facts for node group rules.

As long as a node matches the node group's rules, the node is included in the group and classified with the node group's classification data (classes, parameters, and variables). If the node changes and no longer matches the node group's rules, the node is no longer considered part of the group, and the node group's classification data no longer applies to the node.

  1. In the console, click Node Groups and select the node group you want to add nodes to.
  2. Think about which nodes you want to add to this group and the characteristics of those nodes. Rules are based on Facter facts, so you must determine which facts describe the nodes you want (or don't want) in this group. Then, you can create logical rules based on those facts.

    Rules can be inclusive or exclusive, and you can apply multiple rules to each node group. When you have multiple rules, you can require nodes to match all rules or only match one of the rules.

  3. On the Rules tab, create a fact-based rule, and click Add Rule.

    For example, this rule specifies that nodes in the group must have a Red Hat OS:

    • Fact: osfamily
    • Operator: =
    • Value: RedHat

    Writing node group rules explains the various Operator options and how to select core, structured, and trusted facts.

  4. If needed, add more rules, and select how to apply the rules: select to Or, select to
    • Nodes must match all rules: Combine rules for more granular node selection.
    • Nodes may match any rule: Add a variety of rules to select nodes with different characteristics.
    If you have a few individual nodes that you aren't able to capture with rules, you can Statically add nodes to a node group in addition to your dynamic rules.
  5. Commit changes.

Related information