I'm trying to understand how Salt order and prioritizes matched minions in a top.sls
file for a Pillar.
I want Salt to prioritize my entries in the Pillar but I get seemingly random sorting orders (not first, not last, not alphabetical afaik). I have had a look at the order option but would prefer not to use it (if it is even available in Pillars?)
/srv/pillar/top.sls
base:
'*':
- users
'office-london-*':
- office.general.london
'office-ny-*':
- office.general.ny
'office-*-cust-*':
- office.cust
'office-*-cust-ntp*':
- office.cust-ntp
minions
office-london-cust -> office.general.london
office-london-cust-server1 -> office.cust
office-london-cust-ntp-server1 -> office.cust-ntp
office-ny-cust -> office.general.ny
office-ny-cust-server1 -> office.cust
office-ny-cust-ntp-server1 -> office.cust-ntp
Here are some links to Github issues I've had a look at without figuring this out:
https://github.com/saltstack/salt/pull/1287
https://github.com/saltstack/salt/issues/13657
The minion will look at each match line in order and add the corresponding sls file to its list of sls files to apply. The minion will then compile that list of sls files into a data structure in the same order they were defined in the top.sls.
Require statements and similar requisites can modify the order of execution