我在windows机器上安装了salt minion,并使其成为无主。
我把州档案放在哪里,这样salt就能找到它们。
现在,当我把它保存在C:\salt中并运行salt-call state.sls test -l debug
时,我会得到以下日志,
[DEBUG ] LazyLoaded roots.envs
[DEBUG ] Could not LazyLoad roots.init: 'roots.init' is not available.
[DEBUG ] Updating roots fileserver cache
[DEBUG ] Determining pillar cache
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[INFO ] Loading fresh modules for state activity
[DEBUG ] LazyLoaded jinja.render
[DEBUG ] LazyLoaded yaml.render
[DEBUG ] Could not find file 'salt://test.sls' in saltenv 'base'
[DEBUG ] Could not find file 'salt://test/init.sls' in saltenv 'base'
[DEBUG ] compile template: False
[ERROR ] Template was specified incorrectly: False
[DEBUG ] LazyLoaded highstate.output
local:
Data failed to compile:
----------
No matching sls found for 'test' in env 'base'
Salt将状态文件保存在file_roots变量配置的目录中。要查找位置,请从命令提示符运行:
python2 -c 'import salt.config; master_opts = salt.config.client_config("/etc/salt/master"); print(master_opts["file_roots"])'