Skip to content

Cannot get public IP address in Salt Mine.  #51955

@wl2776

Description

@wl2776

Description of Issue/Question

Tried to obtain public IP addres of a minion and got either nothing or error that public ip address is not found.

Setup

Mine functions are enabled using pillar

/srv/pillar/top.sls:

base:
  '*':
 ...
    - common_mine_functions

/srv/pillar/common_mine_functions.sls

mine_functions:
    network.ip_addrs:
        - type: public

Steps to Reproduce Issue

Command mine.get does not return IP address of a minion.
Running salt-call mine.update on the minion returns error Interface {'type': 'public'} not found.

~$ sudo salt-call mine.update
[ERROR   ] Interface {'type': 'public'} not found.
local:
    True

However, calling network.ip_addrs on the minion returns desired IP address:

sudo salt-call network.ip_addrs type=public
local:
    - 1xx.xxx.xxx.19

Additional details:
this minion runs docker

~$ sudo salt-call network.ip_addrs
local:
    - 1xx.xxx.xxx.19
    - 172.17.0.1
    - 172.18.0.1

this minion has two network cards in bond.

~$ sudo salt-call network.interfaces
local:
    ----------
    bond0:
        ----------
        hwaddr:
            xx:xx:xx:xx:xx:xx
        inet:
            |_
              ----------
              address:
                  xxx.xxx.xxx.xx
              broadcast:
                  xxx.xx.xxx.xxx
              label:
                  bond0
              netmask:
                  255.255.252.0
        inet6:
            |_
              ----------
              address:
                  xxx:Xxx:xxx..
              prefixlen:
                  64
              scope:
                  link
        up:
            True
    br-c79c0b7bfc30:
        ----------
        hwaddr:
            xx:xx:xx:xx
        inet:
            |_
              ----------
              address:
                  172.18.0.1
              broadcast:
                  172.18.255.255
              label:
                  br-c79c0b7bfc30
              netmask:
                  255.255.0.0
        inet6:
            |_
              ----------
              address:
                  xxx:Xxx:xx:x
              prefixlen:
                  64
              scope:
                  link
        up:
            True
    docker0:
        ----------
        hwaddr:
            xx:xxx:xx:xx
        inet:
            |_
              ----------
              address:
                  172.17.0.1
              broadcast:
                  172.17.255.255
              label:
                  docker0
              netmask:
                  255.255.0.0
        inet6:
            |_
              ----------
              address:
                  xxx:xx:xx:xx:xx
              prefixlen:
                  64
              scope:
                  link
        up:
            True
    enp6s0:
        ----------
        hwaddr:
            xx:xx:xx:xx:xx
        up:
            True
    enp7s0:
        ----------
        hwaddr:
            xx:xx:xx:xx:xx
        up:
            True
    lo:
        ----------
        hwaddr:
            00:00:00:00:00:00
        inet:
            |_
              ----------
              address:
                  127.0.0.1
              broadcast:
                  None
              label:
                  lo
              netmask:
                  255.0.0.0
        inet6:
            |_
              ----------
              address:
                  ::1
              prefixlen:
                  128
              scope:
                  host
        up:
            True
    veth2a0144b:
        ----------
        hwaddr:
            xx:xx:xx:xx:xx:xx
        inet6:
            |_
              ----------
              address:
                  xx:xxx:Xx:xx
              prefixlen:
                  64
              scope:
                  link
        parent:
            if587
        up:
            True

Here is the part of trace, that seems relevant to me:

$ sudo salt-call -l all mine.update
...
[DEBUG   ] LazyLoaded jinja.render
[DEBUG   ] LazyLoaded yaml.render
[DEBUG   ] LazyLoaded mine.update
[DEBUG   ] LazyLoaded direct_call.execute
[DEBUG   ] LazyLoaded config.merge
[DEBUG   ] LazyLoaded network.ip_addrs
[ERROR   ] Interface {'type': 'public'} not found.
[DEBUG   ] MinionEvent PUB socket URI: /var/run/salt/minion/minion_event_04e84b3a86_pub.ipc
[DEBUG   ] MinionEvent PULL socket URI: /var/run/salt/minion/minion_event_04e84b3a86_pull.ipc
[DEBUG   ] Initializing new IPCClient for path: /var/run/salt/minion/minion_event_04e84b3a86_pull.ipc
[TRACE   ] IPCClient: Connecting to socket: /var/run/salt/minion/minion_event_04e84b3a86_pull.ipc
[DEBUG   ] Sending event: tag = _minion_mine; data = {'cmd': '_mine', 'data': {'network.ip_addrs': []}, 'id': 'id', 'clear': False, '_stamp': '2019-03-04T14:24:26.318596'}

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Master versions report

~$ salt --versions-report
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
      docker-py: Not Installed
          gitdb: 0.6.4
      gitpython: 1.0.1
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 1.0.3
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.12 (default, Nov 12 2018, 14:36:49)
   python-gnupg: 0.3.8
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: Ubuntu 16.04 xenial
         locale: UTF-8
        machine: x86_64
        release: 4.4.0-142-generic
         system: Linux
        version: Ubuntu 16.04 xenial

Minion versions report

$ salt-minion -V
Salt Version:
           Salt: 2019.2.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.6.1
      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.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 3.6.7 (default, Oct 22 2018, 11:32:17)
   python-gnupg: 0.4.1
         PyYAML: 3.12
          PyZMQ: 16.0.2
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.2.5

System Versions:
           dist: Ubuntu 18.04 bionic
         locale: UTF-8
        machine: x86_64
        release: 4.15.0-45-generic
         system: Linux
        version: Ubuntu 18.04 bionic

Salt master runs on Ubuntu 16.04, python 2
Salt minion runs on Ubuntu 18.04, python 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    ConfirmedSalt engineer has confirmed bug/feature - often including a MCVEbugbroken, incorrect, or confusing behaviorseverity-medium3rd level, incorrect or bad functionality, confusing and lacks a work around

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions