0

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
David Adrian
  • 123
  • 6
  • What's in top.sls, it seems like you gave two different outputs: ` base: '*': - search ` – c4urself Dec 14 '14 at 23:24
  • My bad. I had changed some of the names for simplicity. I've updated the question. – David Adrian Dec 15 '14 at 00:23
  • Can you run: (on master) `salt-run manage.up` `salt '*' test.ping` – c4urself Dec 15 '14 at 00:35
  • Yes, and my one node responds in both. – David Adrian Dec 15 '14 at 02:20
  • have you restarted salt-master and tried to run it in debug mode `salt-master -l debug` – Mike Dec 15 '14 at 03:26
  • @Mike, yes. I see the minion connect and accept the job, and attempt to download the relevant .sls file using `salt://worker/users.sls` – David Adrian Dec 15 '14 at 03:57
  • Can you try to run from the minion? `salt-call -l debug state.highstate` IIRC. – c4urself Dec 15 '14 at 05:26
  • Same log as running it in debug mode off the master--the minion connects, I see the attempts to get the top file, and nothing else. Relevant output here: http://pastebin.com/PMnNWYXJ – David Adrian Dec 15 '14 at 17:46
  • @duiu Can you add the output of `salt-call saltutil.sync_states` from minion to the question? – c4urself Dec 15 '14 at 23:42
  • I reinstalled salt to the lastest stable version from the saltstack ppa for the master, and the bootstrap script on the minion and now it works. I think there might have been a version mismatch in the default Ubuntu repo. – David Adrian Dec 16 '14 at 22:31

1 Answers1

2

In general, when debugging state.highstate you should try:

salt (from master)
salt-call (from minion)

Minion is reachable

Versions match (recommended)

  • Make sure the version of the minion/master packages match. On Ubuntu for example (dpkg -l salt-minion on the minion and dpkg -l salt-master on the master).

Minion is in correct state

  • Clear the cache on the minion completely rm -rm /var/cache/salt/minion/files/base/*
  • Check to make sure the minion has the right grains 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
  • Check /var/log/salt/minion.
c4urself
  • 5,270
  • 3
  • 25
  • 39