Razor

Hostnames

Source

The Razor overview usually does not show the configured hostname of a node.

Editing the client file /usr/local/share/gems/gems/razor-client-1.1.0/lib/razor/cli/views.yaml this can easily been configured.

Add hostname: between line 37 and 38.

  nodes:
+   short:
+     layout: table
+     show:
        name:
+       hostname:
        dhcp_mac

Tags

Tag by Serialnumber

A simple json template to set tags based on the serialnumber reported to razor:

$ cat razor-tags.json
{
  "name": "tag-name",
  "force": true,
  "rule": ["or",
    [ "=", ["fact", "serialnumber"], "0000001"],
    [ "=", ["fact", "serialnumber"], "0000002"],
    [ "=", ["fact", "serialnumber"], "0000003"]
   ]
}

Updating tags

razor update-tag-rule --rule --json ./razor-tags.json