I have a salt master with four environments configured (base, dev, staging, prod)
I am initially trying to set a pillar item to track which envrionment is in use, namely core:env
However when I try to switch environments using the following command I always get the dev environment (it doesn't matter what env I put)
salt 'deploy*' pillar.get core:env saltenv=base
Here are my config files
/etc/salt/master (partial)
file_roots:
base:
- /srv/salt/base/states
dev:
- /srv/salt/dev/states
- /srv/salt/base/states
staging:
- /srv/salt/staging/states
- /srv/salt/base/states
prod:
- /srv/salt/prod/states
- /srv/salt/base/states
pillar_roots:
base:
- /srv/pillar/base/pillars
dev:
- /srv/pillar/dev/pillars
- /srv/pillar/base/pillars
staging:
- /srv/pillar/staging/pillars
- /srv/pillar/base/pillars
prod:
- /srv/pillar/prod/pillars
- /srv/pillar/base/pillars
and my pillars
root@Salt-Master:/srv/pillar# cat base/pillars/top.sls
base:
'deploy':
- core
root@Salt-Master:/srv/pillar# cat base/pillars/core.sls
core:
env: base
root@Salt-Master:/srv/pillar# cat dev/pillars/top.sls
dev:
'deploy':
- core
root@Salt-Master:/srv/pillar# cat dev/pillars/core.sls
core:
env: dev
(the rest follow the same pattern)
I have other data in the base pillar that is being pulled out, but the core:env item won't change from dev.