I'm working on configuring a group of 40 servers to be managed by SaltStack. I'm testing with just one minion at the moment, which I have successfully added to the master. For simplicity, I'm using the latest version of salt and salt-minion from the Ubuntu 14.04.1 package repository on the respective machines.
I have what appears to be a sane configuration and directory structure, however whenever I try running salt '*' state.highstate
, I get an error that the top file does not match the nodes. If I try manually running a state file with salt '*' state.sls worker.users
, it errors that no such file exists. Directory structure and files are below.
Any idea why this is not working?
root@salt-master:/srv/salt# tree /srv/salt
/srv/salt
├── worker
│ └── users.sls
└── top.sls
1 directory, 4 files
root@master:/srv/salt# salt '*' state.highstate
worker-2:
----------
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
The contents of the relevant files:
root@master:/srv/salt# cat top.sls
base:
'*':
- worker.users
root@master:/srv/salt# cat worker/users.sls
worker:
user.present:
- fullname: Service Account
- shell: /bin/bash
- home: /home/worker
admin:
user.present:
- fullname: Search Admin Account
- shell: /bin/bash
- home: /home/admin
File root is defined as follows in the master and I've restarted all the machines:
file_roots:
base:
- /srv/salt
Best Answer
In general, when debugging state.highstate you should try:
salt
(from master)salt-call
(from minion)Minion is reachable
salt '*' test.ping
-- Make sure minions respond to ping (this ensures the minion service is running)Versions match (recommended)
dpkg -l salt-minion
on the minion anddpkg -l salt-master
on the master).Minion is in correct state
rm -rm /var/cache/salt/minion/files/base/*
salt-call grains.items
Check logs
salt-call -l debug state.highstate
-- Check to see if you can catch more information about the error using "debug" mode/var/log/salt/minion
.