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
14.1k stars 5.47k forks source link

The manage.alived(show_ipv4=True) runner incorrectly lists 127.0.0.1 as the source IP #48817

Closed boltronics closed 4 years ago

boltronics commented 6 years ago

Description of Issue/Question

From the docs: "show_ipv4: Also show the IP address each minion is connecting from."

But this is what I get when testing in two completely different environments:

$ sudo salt-call saltutil.runner manage.list_state show_ipv4=True
local:
    ----------
    minion0:
        127.0.0.1
    minion1:
        127.0.0.1
    minion2:
        127.0.0.1
...etc.

These are all different machines - some physical, some virtual. The IP returned should not be the loopback IP.

Executing the command more directly via salt-run (ie. sudo salt-run manage.list_state show_ipv4=True) makes no difference.

On one network I have almost 30 hosts connected but only 3 have the correct IP address provided. Any host with a direct connection to the master (ie. same subnet) returns 127.0.0.1, but there's more to it than that. I have one host from a routed source (the same subnet as other hosts that do return the correct IP) but it too returns 127.0.0.1. The only difference is that it has an OpenVPN interface online (which is not used and cannot be used for reaching the master anyway).

Basically I want to get the IP address of each connected host on the master for injecting into pillar data for a particular Icinga host, without having to resort to having each host add its IP address to the mine. I thought this would be an easy and efficient approach.

Setup

I added presence_events: True to my master configuration, but it didn't make any difference.

Steps to Reproduce Issue

N/A

Versions Report

I've observed this on two independent environments, one running 2018.3.2 and the the other running 2017.7.7.

Salt Version:
           Salt: 2018.3.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.9.4
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.6
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: 1.3.7
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.13 (default, Nov 24 2017, 17:33:09)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.5 
         locale: ANSI_X3.4-1968
        machine: x86_64
        release: 4.9.0-6-amd64
         system: Linux
        version: debian 9.5 
Salt Version:
           Salt: 2017.7.7

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.5.3
      docker-py: Not Installed
          gitdb: 2.0.0
      gitpython: 2.1.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: 1.3.7
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.13 (default, Nov 24 2017, 17:33:09)
   python-gnupg: Not Installed
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: 2.0.1
        timelib: Not Installed
        Tornado: 4.4.3
            ZMQ: 4.2.1

System Versions:
           dist: debian 9.5 
         locale: ANSI_X3.4-1968
        machine: x86_64
        release: 4.9.0-7-amd64
         system: Linux
        version: debian 9.5 
stale[bot] commented 4 years ago

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.