【发布时间】:2018-10-03 17:14:07
【问题描述】:
我正在尝试使用 salt-ssh 将文件从我的 salt master 复制到 minon
带有file.managed 模块。但它给出了以下错误......
[salt]# pwd
/srv/salt
[salt]# ls -l
total 20
-rw-r--r-- 1 root root 80 Sep 4 21:37 copy.sls
-rw-r--r-- 1 root root 47 Sep 3 04:52 lftp_install.sls
-rw-r--r-- 1 root root 44 Sep 3 04:52 lftp_remove.sls
-rw-r--r-- 1 root root 124 Sep 3 04:50 lftp.sls
-rw-r--r-- 1 root root 65 Sep 3 04:53 Service_check.sls
[salt]# cat copy.sls
add script:
file.managed:
- name: testSalt
- source: /root/testSalt
- dest: /tmp/testSalt
来自/etc/salt/master的条目
file_roots:
base:
- /srv/salt
[salt]# salt-ssh 'KK' state.apply copy.sls
KK:
- No matching sls found for 'copy.sls' in env 'base'
When i ran this into the debug mode, it gives as follows..
[DEBUG ] Could not find file from saltenv 'base', 'salt://copy/sls.sls'
[DEBUG ] Could not find file from saltenv 'base', 'salt://copy/sls/init.sls'
[DEBUG ] LazyLoaded nested.output
KK:
- No matching sls found for 'copy.sls' in env 'base'
【问题讨论】:
-
始终使用 yaml lint 检查器来验证缩进中没有混合制表符和空格。 Saltstack 在遇到不正确的 yaml 语法时并不总是显示正确的异常错误。
-
我检查了,我没有看到任何缩进或制表符空间!
-
嘿,你的 top.sls 在哪里?
-
@mootmoot,我没有 top.sls。但我得到了它的工作。
标签: salt-stack