Matcher Groups - nsg/ansible-inventory GitHub Wiki

Matcher groups are tag groups that are automatically classified from your rules. There is a example:

matcher:
  - regexp: '(sto|lon)([a-z]+)'
    capture: True

capture: True means that the script will create groups automatically from the regexp capture groups, (and ). If a host is named stowww1 the groups sto and www will automatically be tagged to the host. This is really powerful and can dramatically reduce the amount of manually created groups in your inventory.

You can also statically assign groups to hosts that matches a regexp, for example let us assign the group london to all hosts named lon...

matcher:
  - regexp: 'lon.*'
    groups:
      - london