Targeting

Minion id

  • unique (FQDN by default)

  • can be overridden in the minion config file

  • if changed, P/P keys need to be regenerated

  • match by shell-style globbing around the minion id or top file

  • use single quote

  • Perl-compatible regex can be used with the -E option

salt '*.be.brussels' test.ping
salt -L 'web1, web2, web3' disk.usage
salt -E 'web[0-9]' cmd.exec_code python 'import sys; print sys.version'
base:
'web-(develjstaging)'
  - match: pcre
  - webserver

Grains

  • static bits of information that a minion collects when the minion starts

  • can be statically described in the minion config file with the option grains

  • available to Salt modules

  • automatically sync when state.highstate is called.

    salt -G 'os:CentOS' --batch-size 25% grains.item num_cpus

Node groups

  • predefined group of minions declared in the master

  • declared using compound matchers (see doc)