Search code examples
salt-project

saltstack: Targeting minions based on grains[id] of other minions


during a deployment: two minions are brought up, I want to target one minion if the other minion has a specific grain['id'], how would I do that?


Solution

  • With the -G option, you can target minions by grains data

    See https://docs.saltstack.com/en/latest/topics/targeting/

    Not sure what do you mean by I want to target one minion if the other minion has a specific grain['id'], how would I do that. But if you want to do some complex targeting, you can try salt orchestration.