5

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 ?

  • 1
    just my 5 cents: if ChrisV's answer does not help, you might be struck by salt bug - it manifested for me when I updated salt-master (and minions afterwards). Before that - everything worked, after - I'm getting same issue. Stuff already tested, but no cigar: remove minion key from master and readd it, check master configs, restart salt-master and salt-minion processess, reboot master and nodes machines... Still to test: reinstall master, reinstall minions (maybe it has something to do with authentication credentials that are being generated dring install) – Marek Bettman Nov 27 '14 at 14:02
  • I have this problem now, Marek did you have any luck? – Efren Jun 1 '16 at 6:04
4

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

| improve this answer | |
  • 2
    Also check /var/log/salt/minion for error messages, that can be caused by a missing sls file, like Rendering exception occurred :Jinja variable 'dict object' has no attribute 'newrelic'. – Fernando Correia Jan 27 '16 at 20:22
0

I had the same issue here. However, my cause was that the times/time zones were different between the master and minion.

After running dpkg-reconfigure tzdata on the minion, this issue was resolved.

| improve this answer | |
0

I had the same issue. In my case there was a repeated minion wildcard pattern in the top.sls file. Salt didn't tell me the file was bad, it said it was not present instead.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.