salt icon indicating copy to clipboard operation
salt copied to clipboard

salt mine in yaml fails

Open leonhedding opened this issue 7 years ago • 1 comments

Description of Issue

As per this page https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.mine.html#salt.modules.mine.get I can't get the salt mine to work in yaml. I can manually run saltutil.runner mine.get from the command line and I get results. But when I place this into test.sls and run it I get line 1 and line 3. Line 2 is reports {}.

{% set minion_ips = salt.saltutil.runner('mine.get',
    tgt='*',
    fun='network.ip_addrs',
    tgt_type='pillar') %}

/tmp/txt.txt:
  file.managed:
    - contents: |
        This is line 1
        {{ minion_ips | tojson }}
        This is line 3

Setup

Salt Master and minions. All running CentOS 7.

Steps to Reproduce Issue

Create test.sls with contents of text above. run salt-call state.apply test. Open /tmp/txt.txt and I do not see any IP info.

Versions Report

Salt Version: Salt: 2019.2.0

Dependency Versions: cffi: Not Installed cherrypy: unknown dateutil: Not Installed docker-py: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed Jinja2: 2.8.1 libgit2: Not Installed libnacl: Not Installed M2Crypto: Not Installed Mako: Not Installed msgpack-pure: Not Installed msgpack-python: 0.5.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pycryptodome: Not Installed pygit2: Not Installed Python: 3.6.8 (default, Apr 25 2019, 21:02:35) python-gnupg: Not Installed PyYAML: 3.12 PyZMQ: 15.3.0 RAET: Not Installed smmap: Not Installed timelib: Not Installed Tornado: 4.4.2 ZMQ: 4.1.4

System Versions: dist: centos 7.6.1810 Core locale: UTF-8 machine: x86_64 release: 3.10.0-957.27.2.el7.x86_64 system: Linux version: CentOS Linux 7.6.1810 Core

leonhedding avatar Aug 16 '19 07:08 leonhedding

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] avatar Jan 08 '20 01:01 stale[bot]