网上大多数都是说sls文件的ymal语法空格和制表符混用导致的问题,我反复确认了自己的sls文件并没有此问题
查看salt-master.log,有如下警告信息打印
[WARNING ] gitfs_global_lock is enabled and update lockfile /xxx/saltstack/master/gitfs/xxx/.git/update.lk is present for gitfs remote 'http://xx@x.x.x.x:8101/saltstack/saltstack-state.git'. Process 141369 obtained the lock but this process is not running. The update may have been interrupted. If using multi-master with shared gitfs cache, the lock may have been obtained by another master.
[WARNING ] Update lock file is present for gitfs remote 'http://xx@x.x.x.x:8101/saltstack/saltstack-state.git', skipping. If this warning persists, it is possible that the update process was interrupted, but the lock could also have been manually set. Removing /xxx/saltstack/master/gitfs/xxxx/.git/update.lk or running 'salt-run cache.clear_git_lock gitfs type=update' will allow updates to continue for this remote.
大致意思是说有一个本地的gitfs的锁导致无法到后端gitlab更新,按照日志提示,删除这个锁文件
rm -f /xxx/saltstack/master/gitfs/xxxx/.git/update.lk
重新执行state.sls,恢复正常
更多saltstack web项目saltshaker的信息,可以看看github链接:
https://github.com/saltshaker-plus