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 ?

4m1nh4j1
  • 167
  • 1
  • 2
  • 8
  • 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 01 '16 at 06:04

3 Answers3

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

4m1nh4j1
  • 167
  • 1
  • 2
  • 8
  • 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.

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.

Anthony Hayward
  • 161
  • 1
  • 3