salt: salt-ssh doesn't pack custom grains into thin tarball

Description of Issue

I’ve been struggling to get custom grains working with salt ssh, and inspecting the state on minions after running commands with salt-ssh -Wt, I’ve noticed that while it packs in the builtin grains, it doesn’t seem to even be attempting to pack in the custom grains I’ve written from _grains.

note that this doesn’t change if I run salt-ssh minionid saltutil.sync_grains, so this may be related to bug #53806.

Setup

write a custom grain, drop it in _grains, verify it works locally with salt-call.

Steps to Reproduce Issue

run salt-ssh -Wt minion_id grains.items and see that grain doesn’t show up. look at the deployed salt-ssh thin dir on the minion and inspect the pyall/salt/grains dir, notice custom grains are not present.

Versions Report

Salt Version:
           Salt: 2019.2.0
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.10.1
        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: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.7.3 (default, Apr  3 2019, 05:39:12)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 18.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.1
 
System Versions:
           dist: Ubuntu 19.04 disco
         locale: UTF-8
        machine: x86_64
        release: 5.0.0-21-generic
         system: Linux
        version: Ubuntu 19.04 disco

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 31 (15 by maintainers)

Most upvoted comments

Okay, I understand this now. This is also my noobness/lack of understanding when it comes to the Saltfile in general. And, I will agree, when I was investigating documentation for the Saltfile itself, it did not cover this instance whatsoever.

@mtorromeo See if this addresses your issue, too. Since I do not have the keen understanding of the Saltfile, I’ll make the documentation gets updated exhaustively with an example such as this so that users in the future do not run into this.

I’ll make a new issue about it so it gets done and sorted. /Edit - When that issue is created I’ll also close this.

Hi @nergdron I’m going to take a quick look at this today and see what’s going on. At least get started on what’s not working correctly.