Skip to content

mine.get not updating / returning (how to refresh the data?) #21871

@nbari

Description

@nbari

While trying to use mines to dynamically update some configuration files, I am not been available to update or get data after changing something on the minion:

For now, I am trying to update an HAproxy conf using this mine:

cat /salt/pillars/haproxy/init.sls:

mine_functions:
    test.ping: []
    network.ip_addrs:
        cidr: '10.15.0.0/16'
        mine_interval: 15

Initially I called the dir /salt/pillars/mine/ and nothing was working until I changed to /salt/pillars/haproxy/, but this maybe related of how python work in terms of using dir/file names.

The state for configuring the HAproxy uses something like:

{%- for server, addrs in salt['mine.get']('node_type:riak', 'network.ip_addrs', expr_form='grain').items() %}
    server {{ server }} {{ addrs[0] }}:8087 weight 1 maxconn 1024 check
{%- endfor %}

For testing I removed the IP of a minion, tried to update the states, but nothing changed also the reply from command line was always the same, therefor I this the following:

salt '*' mine.flush
salt '*' mine.update
salt '*' saltutil.refresh_pillar
salt-run cache.clear_all

After doing this in different combinations, I can't get the IP from the mines, only test.ping seems to work:

salt haproxy mine.get 'node_type:riak' test.ping grain

Therefore I would like to know how to properly update,reflect changes on the mine after something happens on the minion sides.

Master and minions using FreeBSD with:

> salt --versions-report                                                                                                                                                                                                                                                                                                                                                
           Salt: 2014.7.2                                                                                                                                                         
         Python: 2.7.9 (default, Jan  5 2015, 10:39:22)                                                                                                                           
         Jinja2: 2.7.3                                                                                                                                                            
       M2Crypto: 0.22                                                                                                                                                             
 msgpack-python: 0.4.2                                                                                                                                                            
   msgpack-pure: Not Installed                                                                                                                                                    
       pycrypto: 2.6.1                                                                                                                                                            
        libnacl: Not Installed                                                                                                                                                    
         PyYAML: 3.11                                                                                                                                                             
          ioflo: Not Installed                                                                                                                                                    
          PyZMQ: 14.5.0                                                                                                                                                           
           RAET: Not Installed                                                                                                                                                    
            ZMQ: 4.0.5                                                                                                                                                            
           Mako: Not Installed 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions