我正在尝试使用salt-ssh和file.managed模块将文件从我的盐主复制到minon。但它造成了以下错误..。
[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/saltsalt# salt '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'发布于 2017-09-05 14:24:58
我注意到,如果我将文件复制到copy.sls所在的目录(在我的例子中是/srv/salt )中,那么它就能工作了。
# cat copy.sls
add script:
file.managed:
- name: /opt/testSalt
- source: salt://testSalt
- user: root
- mode: 644盐-ssh '*‘state.sls拷贝
KK:
----------
ID: add script
Function: file.managed
Name: /opt/testSalt
Result: True
Comment: File /opt/testSalt updated
Started: 07:19:44.332582
Duration: 20.366 ms
Changes:
----------
diff:
---
+++
@@ -1,1 +1,2 @@
salt copy test
+second commit
Summary
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1https://stackoverflow.com/questions/46047285
复制相似问题