Saltstack not recognizing new branches even if configured and salt-master restarted

When working with Saltstack, it happens that when adding new branches via the salt-master configuration, the branches do not immediately get picked up. IMHO it is an unpractical flaw, but the people remaining to develop Saltstack may have other opinions or deeper knowledge about the constraints the git backends gitpython and pygit2 may impose.

I figured two easy options to get the new branches to work immediately:

Variant 1: Change config, flush the gitfs caches and restart

systemctl stop salt-master && rm -rf /var/cache/salt/master/gitfs/* && rm -rf /var/cache/salt/master/file_lists/* && systemctl start salt-master

Variant 2: Change config, restart, commit & push to the new branch, salt-run filesystem.update (or wait for the git update interval)

systemctl restart salt-master

# Alibi edit something
# git commit -m "Test"
# git push

salt-run fileserver.update # Or wait for the git update interval

If you run any salt-syndic, apply the same measures there, too.

Kommentare

Leave a Reply

Your email address will not be published. Required fields are marked *