The function cache system allows for data to be stored on the master so it can be easily read by other minions
Remove specific function contents of minion. Returns True on success.
CLI Example:
salt '*' mine.delete 'network.interfaces'
Remove all mine contents of minion. Returns True on success.
CLI Example:
salt '*' mine.flush
Get data from the mine based on the target, function and tgt_type
Targets can be matched based on any standard matching system that can be matched on the master via these keywords:
Note that all pillar matches, whether using the compound matching system or the pillar matching system, will be exact matches, with globbing disabled.
CLI Example:
salt '*' mine.get '*' network.interfaces salt '*' mine.get 'os:Fedora' network.interfaces grain salt '*' mine.get 'G@os:Fedora and [email protected]/24' network.ipaddrs compound
See also
Retrieving Mine data from Pillar and Orchestrate
This execution module is intended to be executed on minions. Master-side operations such as Pillar or Orchestrate that require Mine data should use the Mine Runner module
instead; it can be invoked from a Pillar SLS file using the saltutil.runner
module. For example:
{% set minion_ips = salt.saltutil.runner('mine.get',
tgt='*',
fun='network.ip_addrs',
tgt_type='glob') %}
Changed in version 2017.7.8,2018.3.3: When docker.update_mine
is set to False
for a given minion, no mine data will be populated for that minion, and thus none will be returned for it.
Changed in version 2019.2.0: docker.update_mine
now defaults to False
Get all mine data for docker.ps
and run an aggregation routine. The interfaces
parameter allows for specifying the network interfaces from which to select IP addresses. The cidrs
parameter allows for specifying a list of subnets which the IP address must match.
Boolean, to expose container_id in the list of results
New in version 2015.8.2.
CLI Example:
salt '*' mine.get_docker salt '*' mine.get_docker interfaces='eth0' salt '*' mine.get_docker interfaces='["eth0", "eth1"]' salt '*' mine.get_docker cidrs='107.170.147.0/24' salt '*' mine.get_docker cidrs='["107.170.147.0/24", "172.17.42.0/24"]' salt '*' mine.get_docker interfaces='["eth0", "eth1"]' cidrs='["107.170.147.0/24", "172.17.42.0/24"]'
Send a specific function to the mine.
CLI Example:
salt '*' mine.send network.ip_addrs eth0 salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0
Execute the configured functions and send the data back up to the master. The functions to be executed are merged from the master config, pillar and minion config under the option mine_functions:
mine_functions: network.ip_addrs: - eth0 disk.usage: []
This function accepts the following arguments:
Update the mine data on certain functions only. This feature can be used when updating the mine for functions that require refresh at different intervals than the rest of the functions specified under mine_functions in the minion/master config or pillar. A potential use would be together with the scheduler, for example:
schedule: lldp_mine_update: function: mine.update kwargs: mine_functions: net.lldp: [] hours: 12
In the example above, the mine for net.lldp would be refreshed every 12 hours, while network.ip_addrs would continue to be updated as specified in mine_interval.
The function cache will be populated with information from executing these functions
CLI Example:
salt '*' mine.update
List valid entries in mine configuration.
CLI Example:
salt '*' mine.valid
© 2019 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.mine.html