salt-call masterless won't find files

204 views
Skip to first unread message

Samuel Krieg

unread,
Jan 2, 2014, 8:08:29 AM1/2/14
to salt-...@googlegroups.com
Hi,

I'm trying to setup a simple masterless configuration.
I can't make salt find a simple file and I've no idea why.

* Version:
# salt-call --version
salt-call 0.17.4

* My top.sls file:
# cat /srv/salt/top.sls
/etc/motd:
  file.managed:
    - source: salt://motd-common

* The source file actually exists:
# ls -l /srv/salt/motd-common
-rw-r--r-- 1 root root 10 Jan  2 11:57 /srv/salt/motd-common

* the config file is pretty straightforward:
# grep ^[^#] /etc/salt/minion
file_client: local
file_roots:
  base:
    - /srv/salt/

The behaviour is the same when the config file is empty.

* Here the output of the salt-call command:
# salt-call state.highstate --local
[WARNING ] Although 'lspci' was found in path, the current user cannot execute it. Grains output might not be accurate.
[WARNING ] Although 'lspci' was found in path, the current user cannot execute it. Grains output might not be accurate.
[INFO    ] Loading fresh modules for state activity
local:
----------
    State: - no
    Name:      states
    Function:  None
        Result:    False
        Comment:   No Top file or external nodes data matches found
        Changes:  

Summary
------------
Succeeded: 0
Failed:    1
------------
Total:     1


As far as I understand, if no file_client or file_roots is defined and salt-call is executed with the --local option, then salt-call is supposed to search for files in the /srv/salt directory. Am I right?

What am I doing wrong here?

thanks.

Bowen

unread,
Jan 3, 2014, 6:29:32 PM1/3/14
to salt-...@googlegroups.com
Hi Samuel,

I don't believe that you can define state directly in the top.sls file. This file should instead contain a list of environments (base is the default) and the state files that should be loaded for each. So, if you wanted to get your example working, I believe you could use the following:

# /srv/salt/top.sls
base:
  '*':
    - motd

# /srv/salt/motd.sls
/etc/motd:
  file.managed:
    - source: salt://motd-common


See http://docs.saltstack.com/ref/states/top.html for an example of what the top.sls file should contain.
Hopefully this helps.

-
Bowen

Samuel Krieg

unread,
Jan 5, 2014, 8:03:58 AM1/5/14
to salt-...@googlegroups.com
Thank's Bowen, this totally works.
Reply all
Reply to author
Forward
0 new messages