There are two sources of salt configurations: base and overlay.
The goal is to use the base states and pillar data but ignore the base top file, using only the top files from overlay repo.
/srv/salt/
base/
states/
top.sls
base_state.sls
another_base_state.sls
pillars/
top.sls
base_pillar.sls
another_base_pillar.sls
overlay/
states/
top.sls
overlay_state.sls
pillars/
top.sls
overlay_pillar.sls
file_roots:
base:
- /srv/salt/base/states
overlay:
- /srv/salt/overlay/states
pillar_roots:
base:
- /srv/salt/base/pillars
overlay:
- /srv/salt/overlay/pillars
env_order: ['base','overlay']
base:
'*':
- base_state
- another_base_state
salt '*' highstate
should trigger base_state
and overlay_state
, but not another_base_state
- Configure salt-master to use another name for top.sls file
Add to /etc/salt/master:
state_top: overlay_top.sls
- Create /srv/salt/overlay/states/overlay_top.sls
base: '*': - base_state overlay: '*': - overlay_state
salt-master will read only this top-file and ignore all top.sls files in the base environment