We use a salt state to update the saltenv
and pillarenv
in /etc/salt/minion
we call this initial state with the state.apply app.changesaltenv saltenv=newenv pillarenv=newenv
I have not figured out a way to get the salt-minion
to start using this as it's new default without restarting the salt-minion
. Alternatively, I haven't figured out a way to have the salt state restart the minion without it causing the salt state to fail because it loses connectivity with the salt minion.
Any insight into this would be greatly helpful.
state.apply app.changesaltenv saltenv=newenv pillarenv=newenv
then check the env with
config.get saltenv
if I try to add service.restart
to the state, the state fails because the minion stops communicating with the master.
I noticed an article that mentions how to restart the minion in a state but the example does so by causing a state failure.