I couldn't find anything in documentation about having multiple includes under the same key, but when I tried it, I ended up with only that last include keys under the root key.
For example:
/srv/pillar/top.sls
base:
'*':
- ports
cat /srv/pillar/ports/init.sls
include:
- ports.frontend:
key: ports
- ports.backend:
key: ports
/srv/pillar/ports/backend.sls
service1: 10000
service2: 10001
/srv/pillar/ports/frontend.sls
web1: 8000
web2: 8001
The result of salt '*' pillar.items
devoid of other keys looks like this:
ports:
----------
service1:
10000
service2:
10001
Desired result would look like this:
ports:
web1:
8000
web2:
8001
service1:
10000
service2:
10001
Best Answer
Here's the scheme I found that works for me.
It comes down to having intermediary file K that includes all sub-files S1...n, so when I include file K, I specify its
key
argument, having all sub-files under the specified key./srv/pillar/ports/backend.sls
/srv/pillar/ports/frontend.sls
/srv/pillar/ports/all_ports.sls
/srv/pillar/ports/init.sls
/srv/pillar/top.sls
This will result in a pillar key
ports
looking like this:UPDATE
I corrected inappropriate colons as suggested by marco.