saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14k stars 5.47k forks source link

mine.get not matching properly (returning all servers, or no servers) #17196

Closed ekristen closed 9 years ago

ekristen commented 9 years ago

Version: 2014.7.0rc5

When using compound matching, mine.get returns every server. sudo salt '*dev-appnode*' mine.get 'G@environment:dev and G@roles:redis' network.interfaces compound

When using grain matching, no server is returned. sudo salt '*dev-appnode*' mine.get 'roles:redis' network.interfaces grain

When using either the compound or grain server with test.ping the right number of servers is returned.

ekristen commented 9 years ago

I cannot find any errors or anything that would lead to why this is happening.

ekristen commented 9 years ago

I've found that doing a compound search, you can literally put anything in that you want, and it will always return all minions that it has cached data for.

I've found that using a grain search will never match and will always return nothing.

ekristen commented 9 years ago

I was unable to test upgrading to see if this is an issue in later releases due to the fact that compound matching is disabled for mine and publish functions in the latest 2014.7.0 release.

ekristen commented 9 years ago

sudo salt '*dev-appnode*' mine.get 'G@thisisanoneexistentgrain:thiswillnevermatch' network.interfaces compound

That command literally returns every minions network interface data.

basepi commented 9 years ago

I cannot reproduce:

[root@li737-184] [~/salt]
± salt-call mine.get '*' test.ping
local:
    ----------
    basepi-debian:
        True

[root@li737-184] [~/salt]
± salt-call mine.get 'fjdkslfjdklsjflk' test.ping compound
local:
    ----------

[root@li737-184] [~/salt]
± salt-call mine.get 'G@fdjskfldjs:fdjkslfjksdl' test.ping compound
local:
    ----------

[root@li737-184] [~/salt]
± salt-call mine.get 'os_family:debian' test.ping grain
local:
    ----------
    basepi-debian:
        True

[root@li737-184] [~/salt]
± salt --version
salt 2014.7.0rc5 (Helium)
ekristen commented 9 years ago

So I deleted my cache directory and none of my minions had their data.p directory. I sorta have that resolved and grain matching is working again, but compound matching still returns everything.

ekristen commented 9 years ago

At closer inspection it looks like only minions that do not have data.p directories are being returned with the compound searches.

ekristen commented 9 years ago

This is a bug with minion caches .. opened a ticket specifically for the bug, this ticket can be closed

https://github.com/saltstack/salt/issues/17203

basepi commented 9 years ago

Yep, I'm going to close this one in favor of the two new issues I asked @ektristen to open, regarding data.p generation and compound matching behavior.