salt can't recognize the file_roots in the config of master!!!

261 views
Skip to first unread message

Neven

unread,
May 19, 2016, 5:00:54 AM5/19/16
to Salt-users
Hi,buddy!!

I want to execute the following commands:
   1)salt '*' state.sls test  (test is the name of the .sls file and its abspath is /srv/salt/text.sls)
    the result is 
    minion-10-211-55-3:
    Data failed to compile:
----------
    No matching sls found for 'test' in env 'base'

   2)salt '*' cp.get_file salt://hello.txt c:/new/hello.txt makedirs=True (the hello.txt exists in /srv/salt)
    this command does not return any result, it is certainly failed.

I used to executed the two commands successfully, but somehow i can't do this someday. I don't remember which config i changed.

the file_roots part in master config is this:
   file_roots:
     base:
         - /srv/salt
     dev:
         - /srv/salt-dev

I have been stuck in this problem for a few days.Because these two command are related to the env 'base', i think it is the problem of file_roots config. I have already checked my master config is right, and i have restarted the salt-master by service salt-master restart many times to make the config work.

Why salt still has the problem? I need to use these two command in my work.

Any help, direction is appreciated.

Thanks.

Charles Baker

unread,
May 19, 2016, 8:29:12 AM5/19/16
to salt-...@googlegroups.com
What does your top.sls look like?


If the name of the state file is text.sls shouldn't the command be "salt '*' state.sls text"?


--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Charles H. Baker
864.990.1297
Knowing is not enough; we must apply. Willing is not enough; we must do. Bruce Lee

Neven

unread,
May 19, 2016, 11:21:29 PM5/19/16
to Salt-users
Oops!! The abspath is /srv/salt/test.sls. It is wrong when i post the issue.

The test.sls file is:

run-an-exe:
   cmd.run:
        - name: c:/Salt-Minion-2015.8.8-2-AMD64-Setup.exe

I just want to test if salt can control a windows minion to run a .exe from a linux master. When the command is executed successfully, i can check a process named Salt-Minion-2015.8.8-2-AMD64-Setup.exe in the taskmanager.


在 2016年5月19日星期四 UTC+8下午5:00:54,Neven写道:

Charles Baker

unread,
May 21, 2016, 3:34:19 PM5/21/16
to salt-...@googlegroups.com

So what is in your top.sls in /srv/salt?

--

Neven

unread,
May 23, 2016, 3:23:17 AM5/23/16
to Salt-users

There is no top.sls in /srv/salt now. I used to create a top.sls:
base:
 
'*':
   
- test  
But it still split the error: No matching sls found for 'test' in env 'base'.

Even if there is something wrong with .sls file, i can send some file through salt.cp.get_file module.Why cp.get_file command does not work?

My master config and .sls file are using two spaces as an indent.
 
在 2016年5月22日星期日 UTC+8上午3:34:19,Charles Baker写道:

Colton Myers

unread,
May 25, 2016, 12:09:35 PM5/25/16
to salt-...@googlegroups.com
What's the output of `salt '*' cp.list_master` ? That will show all the files that the master shows as available. If the file shows up there then it might be a different issue masquerading as a "not found" issue.

--
Colton Myers
@basepi
Reply all
Reply to author
Forward
0 new messages