To test salt-stack I would like to copy a config file to another distant one (I am testing master and minion in localhost)
/etc/salt/minion :
master: 127.0.0.1
file_roots:
base:
- /srv/salt/base
/etc/salt/master:
interface: 0.0.0.0
The /srv/salt tree :
# tree srv/
srv/
├── salt
│ └── base
│ └── env
│ ├── envpy.template
│ └── init.sls
└── top.sls
and the template file :
# cat /srv/salt/base/env/envpy.template
This is a test !
and this is the init file:
# cat /srv/salt/base/env/init.sls
/home/myHome/env.py:
file:
- managed
- source: salt://base/env/envpy.template
and finally the top file:
# cat /srv/salt/top.sls
base:
'*':
- base.env
Running salt highstate:
# salt '*' state.highstate
myHost:
----------
ID: states
Function: no.None
Result: False
Comment: No Top file or external nodes data matches found
Started:
Duration:
Changes:
Summary
------------
Succeeded: 0
Failed: 1
------------
Total states run: 1
Do you have any idea why I've got this error ?
Best Answer
Paths are relative to your base (
/srv/salt/base
).Try moving your top file to the 'base' directory. Also remove 'base' from the path in the file 'source' reference.
file_roots
should be declared in/etc/salt/master