saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

salt targeting with pillars fails with 2019.2.0 minions #52122

Closed rhavenn closed 5 years ago

rhavenn commented 5 years ago

I used to store a bunch of stuff in custom grains.conf, some of which was host specific, and I switched it all over to pillars. I used to be able to target that data via grains, but when I try to target via salt -I var:value it times out (test.ping and state.apply test=true) and the minion doesn't return even though it picks the correct minions to talk to. My sole remaining 2018 minion does return either the test.ping or state.apply test=true

The pillars do work for pulling data into my .sls files. It's just the targeting that's not functioning.

Setup

My pillars look like:

{% if opts['id'] == 'hostname' %}
   owner: bob
   provider: aws
   location: oh
   role: webserver
   phpversion: php71

Steps to Reproduce Issue

I run: salt "*" saltutil.refresh_pillar and it updates all minions. salt "*" pillar.itmes shows all the data it's supposed to for all minions. salt -I "owner:bob" test.ping only works for my one minion running 2018.

The exact error message is: Minion did not return. [Not connected]

No error messages in the minion logs on the minions.

Versions Report

Master and most minions:

Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.1
   mysql-python: Not Installed
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.8 (default, Jan  3 2019, 03:20:16)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 18.0.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1

System Versions:
           dist:
         locale: UTF-8
        machine: amd64
        release: 11.2-RELEASE-p9
         system: FreeBSD
        version: Not Installed

My 2018 one:

Salt Version:
           Salt: 2018.3.3

Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.1
   mysql-python: 1.3.13
      pycparser: 2.18
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.8 (default, Jan  3 2019, 02:14:40)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 17.1.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1

System Versions:
           dist:
         locale: UTF-8
        machine: amd64
        release: 11.2-RELEASE-p9
         system: FreeBSD
        version: Not Installed
ymasson commented 5 years ago

Hello @rhavenn , It seems like https://github.com/saltstack/salt/issues/51934 (grains targeting)

Have you tried with develop version ?

rhavenn commented 5 years ago

Doing a build from 2019.2 branch this morning and it seems to be fixed. Grains and Pillar targeting works.

Thanks.

Ch3LL commented 5 years ago

thanks for checking that. Since this will be fixed in the 2019.2.1 release I will go ahead and close