Search code examples
salt-project

Target multiple IP addresses in SaltStack


I know it's possible to target a specific IP address or a CIDR using salt's -S <ip_addr> option but let's say I only want to target specific IP addresses and not the entire CIDR, how do you do this in salt?


Solution

  • With compound targeting:

    salt -C 'S@192.168.0.5 or S@192.168.1.2' test.ping
    

    If you're frequently targeting the same set of minions, you could also define a nodegroup for them.