这是我的/ etc / salt / master配置:
#GitFS
gitfs_provider: pygit2
gitfs_base: DEVELOPMENT
gitfs_env_whitelist:
- base
fileserver_backend:
- git
gitfs_remotes:
- ssh://git@github.com/myrepo/salt-states.git:
- pubkey: /root/.ssh/my.pub
- privkey: /root/.ssh/my
- mountpoint: salt:///srv/salt/salt-states
以下是我的目录结构:
.
|-- README.md
|-- formulas
| `-- test
| |-- test.sls
`-- top.sls
这是我非常基本的top.sls:
base:
'*':
- test
如果我尝试在我的测试节点上运行highstate,我会得到:
root@saltmaster:/etc/salt] salt -v '*' state.highstate
Executing job with jid 1234567890
-------------------------------------------
test-minion.domain:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or external nodes data matches found.
Started:
Duration:
Changes:
Summary for test-minion.domain
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Total run time: 0.000 ms
我不确定为什么这不起作用,并希望对此有任何帮助。我尝试过只应用test.sls来查看它是否是问题的顶级文件,但我得到了这个:
root@saltmaster:/etc/salt] salt -v '*' state.sls test
Executing job with jid 1234567890
-------------------------------------------
test-minion.domain:
Data failed to compile:
----------
No matching sls found for 'test' in env 'base'
答案 0 :(得分:2)
我遇到了类似的问题,原因是缓存不同步而且没有更新。如果我试图跑:
salt-run fileserver.update
我得到了:
[警告] gitfs remote'git @ github.com:提及我/ Salt.git',跳过时出现更新锁定文件。如果此警告仍然存在,则更新过程可能会中断,但也可能已手动设置锁定。删除/var/cache/salt/master/gitfs/7d8d9790a933949777fd5a58284b8850/.git/update.lk或运行'salt-run cache.clear_git_lock gitfs type = update'将允许此远程数据库继续更新。
删除指定的缓存文件,并运行上述命令修复了问题。
答案 1 :(得分:1)
我和Saltstack IRC的人谈过,有人帮我解决了这个问题。似乎添加一个挂载点会搞砸一切。归功于:
12:20] == realname : Thomas Phipps
[12:20] == channels : #salt
[12:20] == server : orwell.freenode.net [NL]
[12:20] == : is using a secure connection
[12:20] == account : whytewolf
[12:20] == End of WHOIS