I'm trying to change the default saltenv value on my salt master.
I need that all minions get the production
environment from my salt master. Il removed the base
environment, and made the following configurations :
file_roots:
production:
- /srv/salt/production/states
- /srv/salt/production/formulas
pillar_roots:
production:
- /srv/salt/production/pillar
And :
state_top_saltenv: production
default_top: production
top_file_merging_strategy: same
But, when I run :
salt 'myminion' state.highstate
I get :
No Top file or master_tops data matches found. Please see master log for details.
Running state.apply
, it works.
Why is this ? How to get state.apply and state.highstate behave accordingly ?
I came with those settings by trying to understand the documentation, but I know it's not configured the way I want it :
saltenv=devel
for instance)What I have done to move from base
saltenv to production
one is the following:
base:
occurencesaltenv: production
Last step may be unneeded if you use default_top: production
.
I think that's all, I have some minimal code with kitchen tests to validate it that I can share if you need it.
update: default_top: production
is sufficient for highstates to run correctly, but is not enough if you want to run specific states (with salt <minion> state.sls foo
) => you will need to specify saltenv
argument in the command-line or add it to your minion config