The function cache system allows for data to be stored on the master so it can be easily read by other minions
salt.modules.mine.
delete
(fun)¶Remove specific function contents of minion.
Parameters: | fun (str) -- The name of the function. |
---|---|
Return type: | bool |
Returns: | True on success. |
CLI Example:
salt '*' mine.delete 'network.interfaces'
salt.modules.mine.
flush
()¶Remove all mine contents of minion.
Return type: | bool |
---|---|
Returns: | True on success |
CLI Example:
salt '*' mine.flush
salt.modules.mine.
get
(tgt, fun, tgt_type='glob', exclude_minion=False)¶Get data from the mine.
Parameters: |
|
---|
CLI Example:
salt '*' mine.get '*' network.interfaces
salt '*' mine.get 'os:Fedora' network.interfaces grain
salt '*' mine.get 'G@os:Fedora and S@192.168.5.0/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') %}
salt.modules.mine.
get_docker
(interfaces=None, cidrs=None, with_container_id=False)¶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"]'
salt.modules.mine.
send
(name, *args, **kwargs)¶Send a specific function and its result to the salt mine. This gets stored in either the local cache, or the salt master's cache.
Parameters: | name (str) -- Name of the function to add to the mine. |
---|
The following pameters are extracted from kwargs if present:
Parameters: |
|
---|
Remaining args and kwargs will be passed on to the function to run.
Return type: | bool |
---|---|
Returns: | Whether executing the function and storing the information was successful. |
Changed in version 3000: Added allow_tgt
- and allow_tgt_type
-parameters to specify which
minions are allowed to access this function.
See Targeting Minions for more information about targeting.
CLI Example:
salt '*' mine.send network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0
salt '*' mine.send eth0_ip_addrs mine_function=network.ip_addrs eth0 allow_tgt='G@grain:value' allow_tgt_type=compound
salt.modules.mine.
update
(clear=False, mine_functions=None)¶Call the configured functions and send the data back up to the master. The functions to be called 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:
Parameters: |
|
---|
The function cache will be populated with information from executing these functions
CLI Example:
salt '*' mine.update
salt.modules.mine.
valid
()¶List valid entries in mine configuration.
CLI Example:
salt '*' mine.valid
Docs for previous releases are available on readthedocs.org.
Latest Salt release: latest_release