neulab/tldr huggingface dataset:
salt-run nacl.sealedbox_decrypt pEXHQM6cuaF7A= salt-run nacl.sealedbox_decrypt data='pEXHQM6cuaF7A=' sk_file=/etc/salt/pki/master/nacl salt-run nacl.sealedbox_decrypt data='pEXHQM6cuaF7A=' sk='YmFkcGFzcwo='
salt.runners.nacl.sealedbox_encrypt(data, **kwargs) Encrypt data using a public key generated from nacl.keygen.  The encryptd data can be decrypted using nacl.sealedbox_decrypt only with the secret key.
salt-run nacl.sealedbox_encrypt datatoenc
salt.runners.nacl.secretbox_decrypt(data, **kwargs) Decrypt data that was encrypted using nacl.secretbox_encrypt using the secret key that was generated from nacl.keygen.
salt-run nacl.secretbox_decrypt pEXHQM6cuaF7A= salt-run nacl.secretbox_decrypt data='pEXHQM6cuaF7A=' sk_file=/etc/salt/pki/master/nacl salt-run nacl.secretbox_decrypt data='pEXHQM6cuaF7A=' sk='YmFkcGFzcwo='
salt.runners.nacl.secretbox_encrypt(data, **kwargs) Encrypt data using a secret key generated from nacl.keygen.  The same secret key can be used to decrypt the data using nacl.secretbox_decrypt.
salt-run nacl.secretbox_encrypt datatoenc salt-run nacl.secretbox_encrypt datatoenc sk_file=/etc/salt/pki/master/nacl salt-run nacl.secretbox_encrypt datatoenc sk='YmFkcGFzcwo='
salt.runners.net NET Finder New in version 2017.7.0.
A runner to find network details easily and fast.  It's smart enough to know what you are looking for.
Configuration • Minion (proxy) config To have the complete features, one needs to add the following mine configuration in the minion (proxy) config file:
mine_functions: net.ipaddrs: [] net.lldp: [] net.mac: [] net.arp: [] net.interfaces: []
Which instructs Salt to cache the data returned by the NAPALM-functions.  While they are not mandatory, the less functions configured, the less details will be found by the runner.
• Master config By default the following options can be configured on the master. They are not necessary, but available in case the user has different requirements.
target: * From what minions will collect the mine data. Default: * (collect from all minions).
expr_form: glob Minion matching expression form. Default: glob.
ignore_interfaces A list of interfaces name to ignore. By default will consider all interfaces.
runners: net.find: target: 'edge*' expr_form: 'glob' ignore_interfaces: - lo0 - em1 - jsrv - fxp0 outputter: yaml
salt.runners.net.find(addr, best=True, display=True) Search in all possible entities (Interfaces, MAC tables, ARP tables, LLDP neighbors), using the following mine functions:
• net.mac
• net.arp
• net.lldp
• net.ipaddrs
• net.interfaces
This function has the advantage that it knows where to look, but the output might become quite long as returns all possible matches.
best: True Return only the best match with the interfaces IP networks when the saerching pattern is a valid IP Address or Network.
$ sudo salt-run net.find 10.10.10.7
Details for all interfaces that include network 10.10.10.7/32 - only best match returned ________________________________________________________________________________________________________________________ |    Device    | Interface | Interface Description |  UP  | Enabled | Speed [Mbps] |    MAC Address    |  IP Addresses | ________________________________________________________________________________________________________________________ | edge01.flw01 |    irb    |                       | True |   True  |      -1      | 5C:5E:AB:AC:52:B4 | 10.10.10.1/22 | ________________________________________________________________________________________________________________________
ARP Entries for IP 10.10.10.7 _____________________________________________________________________________ |    Device    |     Interface     |        MAC        |     IP     |  Age  | _____________________________________________________________________________ | edge01.flw01 | irb.349 [ae0.349] | 2C:60:0C:2A:4C:0A | 10.10.10.7 | 832.0 | _____________________________________________________________________________
salt.runners.net.findarp(device=None, interface=None, mac=None, ip=None, display=True) Search for entries in the ARP tables using the following mine functions:
device Return interface data from a certain device only.
interface Return data selecting by interface name.
mac    Search using a specific MAC Address.
ip     Search using a specific IP Address.
display: True Display on the screen or return structured object? Default: True, will return on the CLI.
$ sudo salt-run net.findarp mac=8C:60:0F:78:EC:41
ARP Entries for MAC 8C:60:0F:78:EC:41 ________________________________________________________________________________ |    Device    |     Interface     |        MAC        |       IP      |  Age  | ________________________________________________________________________________ | edge01.bjm01 | irb.171 [ae0.171] | 8C:60:0F:78:EC:41 | 172.172.17.19 | 956.0 | ________________________________________________________________________________
salt.runners.net.findmac(device=None, mac=None, interface=None, vlan=None, display=True) Search in the MAC Address tables, using the following mine functions:
vlan   Search using a VLAN ID.
$ sudo salt-run net.findmac mac=8C:60:0F:78:EC:41
MAC Address(es) _____________________________________________________________________________________________ |    Device    | Interface |        MAC        | VLAN | Static | Active | Moves | Last move | _____________________________________________________________________________________________ | edge01.bjm01 |  ae0.171  | 8C:60:0F:78:EC:41 | 171  | False  |  True  |   0   |    0.0    | _____________________________________________________________________________________________
salt.runners.net.interfaces(device=None, interface=None, title=None, pattern=None, ipnet=None, best=True, display=True) Search for interfaces details in the following mine functions:
pattern Return interfaces that contain a certain pattern in their description.
ipnet  Return interfaces whose IP networks associated include this IP network.
best: True When ipnet is specified, this argument says if the runner should return only the best match (the output will contain at most one row). Default: True (return only the best match).
title  Display a custom title for the table.
$ sudo salt-run net.interfaces interface=vt-0/0/10
Details for interface xe-0/0/0 _________________________________________________________________________________________________________________ |    Device    | Interface | Interface Description |  UP  | Enabled | Speed [Mbps] | MAC Address | IP Addresses | _________________________________________________________________________________________________________________ | edge01.bjm01 | vt-0/0/10 |                       | True |   True  |     1000     |             |              | _________________________________________________________________________________________________________________ | edge01.flw01 | vt-0/0/10 |                       | True |   True  |     1000     |             |              | _________________________________________________________________________________________________________________ | edge01.pos01 | vt-0/0/10 |                       | True |   True  |     1000     |             |              | _________________________________________________________________________________________________________________ | edge01.oua01 | vt-0/0/10 |                       | True |   True  |     1000     |             |              | _________________________________________________________________________________________________________________
salt.runners.net.lldp(device=None, interface=None, title=None, pattern=None, chassis=None, display=True) Search in the LLDP neighbors, using the following mine functions:
pattern Return LLDP neighbors that have contain this pattern in one of the following fields:
• Remote Port ID
• Remote Port Description
• Remote System Name
• Remote System Description
chassis Search using a specific Chassis ID.
$ sudo salt-run net.lldp pattern=Ethernet1/48
salt.runners.net.multi_find(*patterns, **kwargs) Execute multiple search tasks.  This function is based on the find function.  Depending on the search items, some information might overlap.
$ sudo salt-run net.multi_find Ethernet1/49 xe-0/1/2
Pattern "Ethernet1/49" found in one of the following LLDP details
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |    Device    | Interface | Parent Interface | Remote Chassis ID | Remote Port Description | Remote Port ID |          Remote System Description          |   Remote System Name   | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | edge01.oua04 |  xe-0/1/2 |       ae1        | DE:AD:BE:EF:DE:AD |       Ethernet1/49      |                | Cisco NX-OS(tm) n6000, Software (n6000-uk9) | edge07.oua04.dummy.net | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Details for interface xe-0/1/2
----------------------------------------------------------------------------------------------------------------------- |    Device    | Interface | Interface Description | IP Addresses | Enabled |  UP  |    MAC Address    | Speed [Mbps] | ----------------------------------------------------------------------------------------------------------------------- | edge01.oua04 |  xe-0/1/2 |     ae1 sw01.oua04    |              |   True  | True | BE:EF:DE:AD:BE:EF |    10000     | -----------------------------------------------------------------------------------------------------------------------
LLDP Neighbors for interface xe-0/1/2
salt.runners.network Network tools to run from the Master
salt.runners.network.wol(mac, bcast='255.255.255.255', destport=9) Send a "Magic Packet" to wake up a Minion
salt-run network.wol 08-00-27-13-69-77 salt-run network.wol 080027136977 255.255.255.255 7 salt-run network.wol 08:00:27:13:69:77 255.255.255.255 7
salt.runners.network.wollist(maclist, bcast='255.255.255.255', destport=9) Send a "Magic Packet" to wake up a list of Minions.  This list must contain one MAC hardware address per line
salt-run network.wollist '/path/to/maclist' salt-run network.wollist '/path/to/maclist' 255.255.255.255 7 salt-run network.wollist '/path/to/maclist' 255.255.255.255 7
salt.runners.network.wolmatch(tgt, tgt_type='glob', bcast='255.255.255.255', destport=9) Send a "Magic Packet" to wake up Minions that are matched in the grains cache
salt-run network.wolmatch minion_id salt-run network.wolmatch 192.168.0.0/16 tgt_type='ipcidr' bcast=255.255.255.255 destport=7
salt.runners.pagerduty Runner Module for Firing Events via PagerDuty
configuration This module can be used by specifying the name of a configuration profile in the master config.
salt.runners.pagerduty.create_event(service_key=None, description=None, details=None, incident_key=None, profile=None) Create an event in PagerDuty. Designed for use in states.
salt-run pagerduty.create_event <service_key> <description> <details>         profile=my-pagerduty-account
salt.runners.pagerduty.list_escalation_policies(profile=None, api_key=None) This function is an alias of list_policies. List escalation policies belonging to this account
CLI Example: salt-run pagerduty.list_policies my-pagerduty-account salt-run pagerduty.list_escalation_policies my-pagerduty-account
salt.runners.pagerduty.list_incidents(profile=None, api_key=None) List incidents belonging to this account
CLI Example: salt-run pagerduty.list_incidents my-pagerduty-account
salt.runners.pagerduty.list_maintenance_windows(profile=None, api_key=None) This function is an alias of list_windows. List maintenance windows belonging to this account
CLI Example: salt-run pagerduty.list_windows my-pagerduty-account salt-run pagerduty.list_maintenance_windows my-pagerduty-account
salt.runners.pagerduty.list_policies(profile=None, api_key=None) List escalation policies belonging to this account
salt.runners.pagerduty.list_schedules(profile=None, api_key=None) List schedules belonging to this account
CLI Example: salt-run pagerduty.list_schedules my-pagerduty-account
salt.runners.pagerduty.list_services(profile=None, api_key=None) List services belonging to this account
CLI Example: salt-run pagerduty.list_services my-pagerduty-account
salt.runners.pagerduty.list_users(profile=None, api_key=None) List users belonging to this account
CLI Example: salt-run pagerduty.list_users my-pagerduty-account
salt.runners.pagerduty.list_windows(profile=None, api_key=None) List maintenance windows belonging to this account
salt.runners.pillar Functions to interact with the pillar compiler on the master
salt.runners.pillar.clear_pillar_cache(minion='*', **kwargs) Clears the cached values when using pillar_cache
Clears the pillar cache for a specific minion:
salt-run pillar.clear_pillar_cache 'minion'
salt.runners.pillar.show_pillar(minion='*', **kwargs) Returns the compiled pillar either of a specific minion or just the global available pillars. This function assumes that no minion has the id *.  Function also accepts pillarenv as attribute in order to limit to a specific pillar branch of git
shows minion specific pillar:
salt-run pillar.show_pillar 'www.example.com'
shows global pillar:
salt-run pillar.show_pillar
shows global pillar for 'dev' pillar environment: (note that not specifying pillarenv will merge all pillar environments using the master config option pillar_source_merging_strategy.)
salt-run pillar.show_pillar 'pillarenv=dev'
shows global pillar for 'dev' pillar environment and specific pillarenv = dev:
salt-run pillar.show_pillar 'saltenv=dev' 'pillarenv=dev'
import salt.config import salt.runner opts = salt.config.master_config('/etc/salt/master') runner = salt.runner.RunnerClient(opts) pillar = runner.cmd('pillar.show_pillar', []) print(pillar)
salt.runners.pillar.show_pillar_cache(minion='*', **kwargs) Shows the cached values in pillar_cache
Shows the pillar cache for a specific minion:
salt-run pillar.show_pillar_cache 'minion'
salt.runners.pillar.show_top(minion=None, saltenv='base') Returns the compiled top data for pillar for a specific minion. If no minion is specified, we use the first minion we find.
salt-run pillar.show_top
salt.runners.pkg Package helper functions using salt.modules.pkg
salt.runners.pkg.list_upgrades(jid, style='group', outputter='nested', ext_source=None) Show list of available pkg upgrades using a specified format style
salt-run pkg.list_upgrades jid=20141120114114417719 style=group
salt.runners.queue General management and processing of queues. This runner facilitates interacting with various queue backends such as the included sqlite3 queue or the planned AWS SQS and Redis queues
The queue functions such as insert, delete, and pop can be used for typical management of the queue.
The process_queue function pops the requested number of items from the queue and creates a Salt Event that can then be processed by a Reactor. The process_queue function can be called manually, or can be configured to run on a schedule with the Salt Scheduler or regular system cron. It is also possible to use the peer system to allow a minion to call the runner.
This runner, as well as the Queues system, is not api stable at this time.
There are many things that could potentially be done with queues within Salt.  For the time being the focus will be on queueing infrastructure actions on specific minions. The queues generally will be populated with minion IDs.  When the process_queue runner function is called events are created on the Salt Event bus that indicate the queue and a list of one or more minion IDs. The reactor is set up to match on event tags for a specific queue and then take infrastructure actions on those minion IDs. These actions might be to delete the minion's key from the master, use salt-cloud to destroy the vm, or some other custom action.
Queued runners Using the Salt Queues, references to the commandline arguments of other runners can be saved to be processed later.  The queue runners require a queue backend that can store json data (default: pgjsonb).
Once the queue is setup, the runner_queue will need to be configured.
runner_queue: queue: runners backend: pgjsonb
NOTE: only the queue is required, this defaults to using pgjsonb
Once this is set, then the following can be added to the scheduler on the master and it will run the specified amount of commands per time period.
schedule: runner queue: schedule: function: queue.process_runner minutes: 1 kwargs: quantity: 2
The above configuration will pop 2 runner jobs off the runner queue, and then run them.  And it will do this every minute, unless there are any jobs that are still running from the last time the process_runner task was executed.
salt.runners.queue.delete(queue, items, backend='sqlite') Delete an item or items from a queue
salt-run queue.delete myqueue myitem salt-run queue.delete myqueue myitem backend=sqlite salt-run queue.delete myqueue "['item1', 'item2', 'item3']"
salt.runners.queue.insert(queue, items, backend='sqlite') Add an item or items to a queue
salt-run queue.insert myqueue myitem salt-run queue.insert myqueue "['item1', 'item2', 'item3']" salt-run queue.insert myqueue myitem backend=sqlite salt-run queue.insert myqueue "['item1', 'item2', 'item3']" backend=sqlite
salt.runners.queue.insert_runner(fun, args=None, kwargs=None, queue=None, backend=None) Insert a reference to a runner into the queue so that it can be run later.
fun    The runner function that is going to be run
args   list or comma-separated string of args to send to fun
kwargs dictionary of keyword arguments to send to fun
queue  queue to insert the runner reference into
backend backend that to use for the queue
salt-run queue.insert_runner test.stdout_print salt-run queue.insert_runner event.send test_insert_runner kwargs='{"data": {"foo": "bar"}}'
salt.runners.queue.list_items(queue, backend='sqlite') List contents of a queue
salt-run queue.list_items myqueue salt-run queue.list_items myqueue backend=sqlite
salt.runners.queue.list_length(queue, backend='sqlite') Provide the number of items in a queue
salt-run queue.list_length myqueue salt-run queue.list_length myqueue backend=sqlite
salt.runners.queue.list_queues(backend='sqlite') Return a list of Salt Queues on the backend
salt-run queue.list_queues salt-run queue.list_queues backend=sqlite
salt.runners.queue.pop(queue, quantity=1, backend='sqlite', is_runner=False) Pop one or more or all items from a queue
salt-run queue.pop myqueue salt-run queue.pop myqueue 6 salt-run queue.pop myqueue all salt-run queue.pop myqueue 6 backend=sqlite salt-run queue.pop myqueue all backend=sqlite
salt.runners.queue.process_queue(queue, quantity=1, backend='sqlite', is_runner=False) Pop items off a queue and create an event on the Salt event bus to be processed by a Reactor.
salt-run queue.process_queue myqueue salt-run queue.process_queue myqueue 6 salt-run queue.process_queue myqueue all backend=sqlite
salt.runners.queue.process_runner(quantity=1, queue=None, backend=None) Process queued runners
quantity number of runners to process
salt-run queue.process_runner salt-run queue.process_runner 5
salt.runners.reactor A convenience system to manage reactors
Beginning in the 2017.7 release, the reactor runner requires that the reactor system is running.  This is accomplished one of two ways, either by having reactors configured or by including reactor in the engine configuration for the Salt master.
engines:
• reactor
salt.runners.reactor.add(event, reactors, saltenv='base', test=None) Add a new reactor
salt-run reactor.add 'salt/cloud/*/destroyed' reactors='/srv/reactor/destroy/*.sls'
salt.runners.reactor.delete(event, saltenv='base', test=None) Delete a reactor
salt-run reactor.delete 'salt/cloud/*/destroyed'
salt.runners.reactor.is_leader() Return whether the running reactor is acting as a leader (responding to events).
salt-run reactor.is_leader
salt.runners.reactor.list_(saltenv='base', test=None) List currently configured reactors
salt-run reactor.list
salt.runners.reactor.set_leader(value=True) Set the current reactor to act as a leader (responding to events). Defaults to True
salt-run reactor.set_leader True
salt.runners.salt This runner makes Salt's execution modules available on the salt master.
Salt's execution modules are normally available on the salt minion. Use this runner to call execution modules on the salt master.  Salt execution modules are the functions called by the salt command.
Execution modules can be called with salt-run:
salt-run salt.cmd test.ping # call functions with arguments and keyword arguments salt-run salt.cmd test.arg 1 2 3 key=value a=1
Execution modules are also available to salt runners:
__salt__['salt.cmd'](fun=fun, args=args, kwargs=kwargs)
salt.runners.salt.cmd(fun, *args, **kwargs) Changed in version 2018.3.0: Added with_pillar argument
Execute fun with the given args and kwargs.  Parameter fun should be the string name of the execution module to call.
NOTE: Execution modules will be loaded every time this function is called.  Additionally, keep in mind that since runners execute on the master, custom execution modules will need to be synced to the master using salt-run saltutil.sync_modules, otherwise they will not be available.
with_pillar False If True, pillar data will be compiled for the master
NOTE: To target the master in the pillar top file, keep in mind that the default id for the master is <hostname>_master. This can be overridden by setting an id configuration parameter in the master config file.
salt-run salt.cmd test.ping # call functions with arguments and keyword arguments salt-run salt.cmd test.arg 1 2 3 a=1 salt-run salt.cmd mymod.myfunc with_pillar=True
salt.runners.salt.execute(tgt, fun, arg=(), timeout=None, tgt_type='glob', ret='', jid='', kwarg=None, **kwargs) New in version 2017.7.0.
Execute fun on all minions matched by tgt and tgt_type.  Parameter fun is the name of execution module function to call.
This function should mainly be used as a helper for runner modules, in order to avoid redundant code.  For example, when inside a runner one needs to execute a certain function on arbitrary groups of minions, only has to:
ret1 = __salt__['salt.execute']('*', 'mod.fun') ret2 = __salt__['salt.execute']('my_nodegroup', 'mod2.fun2', tgt_type='nodegroup')
It can also be used to schedule jobs directly on the master, for example:
schedule: collect_bgp_stats: function: salt.execute args: - edge-routers - bgp.neighbors kwargs: tgt_type: nodegroup days: 1 returner: redis
salt.runners.saltutil The Saltutil runner is used to sync custom types to the Master. See the saltutil module for documentation on managing updates to minions.
salt.runners.saltutil.sync_all(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync all custom types
salt-run saltutil.sync_all salt-run saltutil.sync_all extmod_whitelist={'runners': ['custom_runner'], 'grains': []}
salt.runners.saltutil.sync_cache(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2017.7.0.
Sync cache modules from salt://_cache to the master
salt-run saltutil.sync_cache
salt.runners.saltutil.sync_clouds(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2017.7.0.
Sync cloud modules from salt://_clouds to the master
salt-run saltutil.sync_clouds
salt.runners.saltutil.sync_eauth_tokens(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2018.3.0.
Sync eauth token modules from salt://_tokens to the master
salt-run saltutil.sync_eauth_tokens
salt.runners.saltutil.sync_engines(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync engines from salt://_engines to the master
salt-run saltutil.sync_engines
salt.runners.saltutil.sync_executors(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 3000.
Sync executor modules from salt://_executors to the master
salt-run saltutil.sync_executors
salt.runners.saltutil.sync_fileserver(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2018.3.0.
Sync fileserver modules from salt://_fileserver to the master
salt-run saltutil.sync_fileserver
salt.runners.saltutil.sync_grains(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync grains modules from salt://_grains to the master
salt-run saltutil.sync_grains
salt.runners.saltutil.sync_modules(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync execution modules from salt://_modules to the master
salt-run saltutil.sync_modules
salt.runners.saltutil.sync_output(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync output modules from salt://_output to the master
salt-run saltutil.sync_output
salt.runners.saltutil.sync_pillar(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync pillar modules from salt://_pillar to the master
salt-run saltutil.sync_pillar
salt.runners.saltutil.sync_proxymodules(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync proxy modules from salt://_proxy to the master
salt-run saltutil.sync_proxymodules
salt.runners.saltutil.sync_queues(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync queue modules from salt://_queues to the master
salt-run saltutil.sync_queues
salt.runners.saltutil.sync_renderers(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync renderer modules from from salt://_renderers to the master
salt-run saltutil.sync_renderers
salt.runners.saltutil.sync_returners(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync returner modules from salt://_returners to the master
salt-run saltutil.sync_returners
salt.runners.saltutil.sync_roster(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2017.7.0.
Sync roster modules from salt://_roster to the master
salt-run saltutil.sync_roster
salt.runners.saltutil.sync_runners(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync runners from salt://_runners to the master
salt-run saltutil.sync_runners
salt.runners.saltutil.sync_sdb(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2017.7.0.
Sync sdb modules from salt://_sdb to the master
salt-run saltutil.sync_sdb
salt.runners.saltutil.sync_serializers(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2019.2.0.
Sync serializer modules from salt://_serializers to the master
salt-run saltutil.sync_utils
salt.runners.saltutil.sync_states(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync state modules from salt://_states to the master
salt-run saltutil.sync_states
salt.runners.saltutil.sync_thorium(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2018.3.0.
Sync Thorium from salt://_thorium to the master
saltenv: base The fileserver environment from which to sync. To sync from more than one environment, pass a comma-separated list.
salt-run saltutil.sync_thorium
salt.runners.saltutil.sync_tops(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2016.3.7,2016.11.4,2017.7.0.
Sync master_tops modules from salt://_tops to the master
salt-run saltutil.sync_tops
salt.runners.saltutil.sync_utils(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) New in version 2016.11.0.
Sync utils modules from salt://_utils to the master
salt.runners.saltutil.sync_wheel(saltenv='base', extmod_whitelist=None, extmod_blacklist=None) Sync wheel modules from salt://_wheel to the master
salt-run saltutil.sync_wheel
salt.runners.sdb Runner for setting and querying data via the sdb API on the master
salt.runners.sdb.delete(uri) Delete a value from a db, using a uri in the form of sdb://<profile>/<key>.  If the uri provided does not start with sdb:// or the value is not successfully deleted, return False.
salt-run sdb.delete sdb://mymemcached/foo
salt.runners.sdb.get(uri) Get a value from a db, using a uri in the form of sdb://<profile>/<key>. If the uri provided does not start with sdb://, then it will be returned as-is.
salt-run sdb.get sdb://mymemcached/foo
salt.runners.sdb.get_or_set_hash(uri, length=8, chars='abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') Perform a one-time generation of a hash and write it to sdb.  If that value has already been set return the value instead.
salt-run sdb.get_or_set_hash 'SECRET_KEY' 50
salt.runners.sdb.set_(uri, value) Set a value in a db, using a uri in the form of sdb://<profile>/<key>.  If the uri provided does not start with sdb:// or the value is not successfully set, return False.
salt-run sdb.set sdb://mymemcached/foo bar
salt.runners.smartos_vmadm Runner for SmartOS minions control vmadm
salt.runners.smartos_vmadm.get(search, one=True) Return information for vms
search string filter vms, see the execution module.
one    boolean return only one vm
NOTE: If the search parameter does not contain an equal (=) symbol it will be assumed it will be tried as uuid, hostname, and alias.
salt-run vmadm.get 91244bba-1146-e4ec-c07e-e825e0223aa9 salt-run vmadm.get search='alias=saskia'
salt.runners.smartos_vmadm.is_running(search) Return true if vm is running
NOTE: If multiple vms are matched, the result will be true of ALL vms are running
salt-run vmadm.is_running 91244bba-1146-e4ec-c07e-e825e0223aa9 salt-run vmadm.is_running search='alias=julia'
salt.runners.smartos_vmadm.list_vms(search=None, verbose=False) List all vms
search string filter vms, see the execution module
verbose boolean print additional information about the vm
salt-run vmadm.list salt-run vmadm.list search='type=KVM' salt-run vmadm.list verbose=True
salt.runners.smartos_vmadm.nodes(verbose=False) List all compute nodes
verbose boolean print additional information about the node e.g. platform version, hvm capable, ...
salt-run vmadm.nodes salt-run vmadm.nodes verbose=True
salt.runners.smartos_vmadm.reboot(search, one=True, force=False) Reboot one or more vms
one    boolean reboot only one vm
force  boolean force reboot, faster but no graceful shutdown
salt-run vmadm.reboot 91244bba-1146-e4ec-c07e-e825e0223aa9 salt-run vmadm.reboot search='alias=marije' salt-run vmadm.reboot search='type=KVM' one=False
salt.runners.smartos_vmadm.start(search, one=True) Start one or more vms
one    boolean start only one vm
salt-run vmadm.start 91244bba-1146-e4ec-c07e-e825e0223aa9 salt-run vmadm.start search='alias=jiska' salt-run vmadm.start search='type=KVM' one=False
salt.runners.smartos_vmadm.stop(search, one=True) Stop one or more vms
one    boolean stop only one vm
salt-run vmadm.stop 91244bba-1146-e4ec-c07e-e825e0223aa9 salt-run vmadm.stop search='alias=jody' salt-run vmadm.stop search='type=KVM' one=False
salt.runners.spacewalk Spacewalk Runner New in version 2016.3.0.
Runner to interact with Spacewalk using Spacewalk API
codeauthor Nitin Madhok <nmadhok@g.clemson.edu>, Joachim Werner <‐ joe@suse.com>, Benedikt Werner <1benediktwerner@gmail.com>
To use this runner, set up the Spacewalk URL, username and password in the master configuration at /etc/salt/master or /etc/salt/master.d/spacewalk.conf:
spacewalk: spacewalk01.domain.com: username: 'testuser' password: 'verybadpass' spacewalk02.domain.com: username: 'testuser' password: 'verybadpass'
NOTE: Optionally, protocol can be specified if the spacewalk server is not using the defaults. Default is protocol: https.
salt.runners.spacewalk.addGroupsToKey(server, activation_key, groups) Add server groups to a activation key
salt-run spacewalk.addGroupsToKey spacewalk01.domain.com 1-my-key '[group1, group2]'
salt.runners.spacewalk.api(server, command, *args, **kwargs) Call the Spacewalk xmlrpc api.
salt-run spacewalk.api spacewalk01.domain.com systemgroup.create MyGroup Description salt-run spacewalk.api spacewalk01.domain.com systemgroup.create arguments='["MyGroup", "Description"]'
create_group: salt.runner: - name: spacewalk.api - server: spacewalk01.domain.com - command: systemgroup.create - arguments: - MyGroup - Description
salt.runners.spacewalk.deleteAllActivationKeys(server) Delete all activation keys from Spacewalk
salt-run spacewalk.deleteAllActivationKeys spacewalk01.domain.com
salt.runners.spacewalk.deleteAllGroups(server) Delete all server groups from Spacewalk
salt.runners.spacewalk.deleteAllSystems(server) Delete all systems from Spacewalk
salt-run spacewalk.deleteAllSystems spacewalk01.domain.com
salt.runners.spacewalk.unregister(name, server_url) Unregister specified server from Spacewalk
salt-run spacewalk.unregister my-test-vm spacewalk01.domain.com
salt.runners.ssh A Runner module interface on top of the salt-ssh Python API.
This allows for programmatic use from salt-api, the Reactor, Orchestrate, etc.
salt.runners.ssh.cmd(tgt, fun, arg=(), timeout=None, tgt_type='glob', kwarg=None) New in version 2015.5.0.
Execute a single command via the salt-ssh subsystem and return all routines at once
A wrapper around the SSHClient.cmd method.
salt.runners.state Execute orchestration functions
salt.runners.state.event(tagmatch='*', count=- 1, quiet=False, sock_dir=None, pretty=False, node='master') Watch Salt's event bus and block until the given tag is matched
• node -- Watch the minion-side or master-side event bus. .. versionadded:: 2016.3.0
# Reboot a minion and run highstate when it comes back online salt 'jerry' system.reboot && \\ salt-run state.event 'salt/minion/jerry/start' count=1 quiet=True && \\ salt 'jerry' state.highstate
# Reboot multiple minions and run highstate when all are back online salt -L 'kevin,stewart,dave' system.reboot && \\ salt-run state.event 'salt/minion/*/start' count=3 quiet=True && \\ salt -L 'kevin,stewart,dave' state.highstate
# Watch the event bus forever in a shell while-loop. salt-run state.event | while read -r tag data; do echo $tag echo $data | jq --color-output . done
SEE ALSO: See https://github.com/saltstack/salt/blob/master/tests/eventlisten.sh for an example of usage within a shell script.
salt.runners.state.orch(mods, saltenv='base', test=None, exclude=None, pillar=None, pillarenv=None, pillar_enc=None, orchestration_jid=None) This function is an alias of orchestrate. New in version 0.17.0.
Execute a state run from the master, used as a powerful orchestration system.
• Docs for the master-side state module
salt-run state.orchestrate webserver salt-run state.orchestrate webserver saltenv=dev test=True salt-run state.orchestrate webserver saltenv=dev pillarenv=aws
Changed in version 2014.1.1: Runner renamed from state.sls to state.orchestrate
Changed in version 2014.7.0: Runner uses the pillar variable
Changed in version 2017.5: Runner uses the pillar_enc variable that allows renderers to render the pillar.  This is usable when supplying the contents of a file as pillar, and the file contains gpg-encrypted entries.
SEE ALSO: GPG renderer documentation
salt-run state.orchestrate webserver pillar_enc=gpg pillar="$(cat somefile.json)"
salt.runners.state.orch_show_sls(mods, saltenv='base', test=None, queue=False, pillar=None, pillarenv=None, pillar_enc=None) This function is an alias of orchestrate_show_sls. Display the state data from a specific sls, or list of sls files, after being render using the master minion.
Note, the master minion adds a "_master" suffix to its minion id.
SEE ALSO: The state.show_sls module function
salt-run state.orch_show_sls my-orch-formula.my-orch-state 'pillar={ nodegroup: ng1 }'
salt.runners.state.orchestrate(mods, saltenv='base', test=None, exclude=None, pillar=None, pillarenv=None, pillar_enc=None, orchestration_jid=None) New in version 0.17.0.
salt.runners.state.orchestrate_high(data, test=None, queue=False, pillar=None, **kwargs) Execute a single state orchestration routine
salt-run state.orchestrate_high '{ stage_one: {salt.state: [{tgt: "db*"}, {sls: postgres_setup}]}, stage_two: {salt.state: [{tgt: "web*"}, {sls: apache_setup}, { require: [{salt: stage_one}], }]}, }'
salt.runners.state.orchestrate_show_sls(mods, saltenv='base', test=None, queue=False, pillar=None, pillarenv=None, pillar_enc=None) Display the state data from a specific sls, or list of sls files, after being render using the master minion.
salt.runners.state.orchestrate_single(fun, name, test=None, queue=False, pillar=None, **kwargs) Execute a single state orchestration routine
salt-run state.orchestrate_single fun=salt.wheel name=key.list_all
salt.runners.state.pause(jid, state_id=None, duration=None) Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds.
salt.runners.state.resume(jid, state_id=None) Remove a pause from a jid, allowing it to continue
salt.runners.state.rm_pause(jid, state_id=None) This function is an alias of resume. Remove a pause from a jid, allowing it to continue
salt.runners.state.set_pause(jid, state_id=None, duration=None) This function is an alias of pause. Set up a state id pause, this instructs a running state to pause at a given state id. This needs to pass in the jid of the running state and can optionally pass in a duration in seconds.
salt.runners.state.sls(mods, saltenv='base', test=None, exclude=None, pillar=None, pillarenv=None, pillar_enc=None, orchestration_jid=None) This function is an alias of orchestrate. New in version 0.17.0.
salt.runners.state.soft_kill(jid, state_id=None) Set up a state run to die before executing the given state id, this instructs a running state to safely exit at a given state id. This needs to pass in the jid of the running state.  If a state_id is not passed then the jid referenced will be safely exited at the beginning of the next state run.
salt.runners.survey A general map/reduce style salt runner for aggregating results returned by several different minions.
Aggregated results are sorted by the size of the minion pools which returned matching results.
Useful for playing the game: "some of these things are not like the others..."  when identifying discrepancies in a large infrastructure managed by salt.
salt.runners.survey.diff(*args, **kwargs) Return the DIFFERENCE of the result sets returned by each matching minion pool
These pools are determined from the aggregated and sorted results of a salt command.
This command displays the "diffs" as a series of 2-way differences -- namely the difference between the FIRST displayed minion pool (according to sort order) and EACH SUBSEQUENT minion pool result set.
Differences are displayed according to the Python difflib.unified_diff() as in the case of the salt execution module file.get_diff.
This command is submitted via a salt runner using the general form:
salt-run survey.diff [survey_sort=up/down] <target> <salt-execution-module> <salt-execution-module parameters>
Optionally accept a survey_sort= parameter. Default: survey_sort=down
CLI Example #1: (Example to display the "differences of files")
salt-run survey.diff survey_sort=up "*" cp.get_file_str file:///etc/hosts
salt.runners.survey.hash(*args, **kwargs) Return the MATCHING minion pools from the aggregated and sorted results of a salt command
salt-run survey.hash [survey_sort=up/down] <target> <salt-execution-module> <salt-execution-module parameters>
CLI Example #1: (functionally equivalent to salt-run manage.up)
salt-run survey.hash "*" test.ping
CLI Example #2: (find an "outlier" minion config file)
salt-run survey.hash "*" file.get_hash /etc/salt/minion survey_sort=up
salt.runners.test This runner is used only for test purposes and servers no production purpose
salt.runners.test.arg(*args, **kwargs) Output the given args and kwargs
Kwargs will be filtered for 'private' keynames.
salt.runners.test.get_opts() New in version 2018.3.0.
Return the configuration options of the master.
salt-run test.get_opts
salt.runners.test.metasyntactic(locality='us') Return common metasyntactic variables for the given locality
salt.runners.test.raw_arg(*args, **kwargs) Output the given args and kwargs
salt.runners.test.sleep(s_time=10) Sleep t seconds, then return True
salt.runners.test.stdout_print() Print 'foo' and return 'bar'
salt.runners.test.stream() Return True
salt.runners.thin The thin runner is used to manage the salt thin systems.
Salt Thin is a transport-less version of Salt that can be used to run routines in a standalone way. This runner has tools which generate the standalone salt system for easy consumption.
salt.runners.thin.generate(extra_mods='', overwrite=False, so_mods='', absonly=True, compress='gzip') Generate the salt-thin tarball and print the location of the tarball Optional additional mods to include (e.g. mako) can be supplied as a comma delimited string.  Permits forcing an overwrite of the output file as well.
salt-run thin.generate salt-run thin.generate mako salt-run thin.generate mako,wempy 1 salt-run thin.generate overwrite=1
salt.runners.thin.generate_min(extra_mods='', overwrite=False, so_mods='') Generate the salt-thin tarball and print the location of the tarball Optional additional mods to include (e.g. mako) can be supplied as a comma delimited string.  Permits forcing an overwrite of the output file as well.
salt-run thin.generate_min
salt.runners.vault maintainer SaltStack
Runner functions supporting the Vault modules. Configuration instructions are documented in the execution module docs.
salt.runners.vault.generate_token(minion_id, signature, impersonated_by_master=False, ttl=None, uses=None) Generate a Vault token for minion minion_id
minion_id The id of the minion that requests a token
signature Cryptographic signature which validates that the request is indeed sent by the minion (or the master, see impersonated_by_master).
impersonated_by_master If the master needs to create a token on behalf of the minion, this is True. This happens when the master generates minion pillars.
ttl    Ticket time to live in seconds, 1m minutes, or 2h hrs
uses   Number of times a token can be used
salt.runners.vault.show_policies(minion_id) Show the Vault policies that are applied to tokens for the given minion
minion_id The minions id
salt-run vault.show_policies myminion
salt.runners.vault.unseal() Unseal Vault server
This function uses the 'keys' from the 'vault' configuration to unseal vault server
keys:
• n63/TbrQuL3xaIW7ZZpuXj/tIfnK1/MbVxO4vT3wYD2A
• S9OwCvMRhErEA4NVVELYBs6w/Me6+urgUr24xGK44Uy3
• F1j4b7JKq850NS6Kboiy5laJ0xY8dWJvB3fcwA+SraYl
• 1cYtvjKJNDVam9c7HNqJUfINk4PYyAXIpjkpN/sIuzPv
• 3pPK5X6vGtwLhNOFv1U2elahECz3HpRUfNXJFYLw6lid
salt-run vault.unseal
salt.runners.venafiapi Support for Venafi
• vcert Python module
configuration In order to connect to Venafi services you need to specify it in Salt master configuration.  Example for Venafi Cloud (using env variables):
venafi: api_key: "sdb://osenv/CLOUDAPIKEY"
Example for Venafi Platform (using env variables):
venafi: base_url: "https://tpp.example.com/" tpp_user: admin tpp_password: "sdb://osenv/TPP_PASSWORD" trust_bundle: "/opt/venafi/bundle.pem"
salt.runners.venafiapi.del_cached_domain(domains) Delete cached domains from the master
salt-run venafi.del_cached_domain domain1.example.com,domain2.example.com
salt.runners.venafiapi.list_domain_cache() List domains that have been cached
salt-run venafi.list_domain_cache
salt.runners.venafiapi.renew(minion_id, dns_name=None, zone=None, country=None, state=None, loc=None, org=None, org_unit=None, key_password=None, csr_path=None, pkey_path=None) Request a new certificate
salt-run venafi.request <minion_id> <dns_name>
salt.runners.venafiapi.request(minion_id, dns_name=None, zone=None, country=None, state=None, loc=None, org=None, org_unit=None, key_password=None, csr_path=None, pkey_path=None) Request a new certificate
salt.runners.venafiapi.show_cert(dns_name) Show issued certificate for domain
salt-run venafi.show_cert example.com
salt.runners.virt Control virtual machines via Salt
salt.runners.virt.force_off(name) Force power down the named virtual machine
salt.runners.virt.host_info(host=None) Return information about the host connected to this master
salt.runners.virt.init(name, cpu, mem, image, hypervisor='kvm', host=None, seed=True, nic='default', install=True, start=True, disk='default', saltenv='base', enable_vnc=False, seed_cmd='seed.apply', enable_qcow=False, serial_type='None') This routine is used to create a new virtual machine. This routines takes a number of options to determine what the newly created virtual machine will look like.
name   The mandatory name of the new virtual machine. The name option is also the minion id, all minions must have an id.
cpu    The number of cpus to allocate to this new virtual machine.
mem    The amount of memory to allocate to this virtual machine. The number is interpreted in megabytes.
image  The network location of the virtual machine image, commonly a location on the salt fileserver, but http, https and ftp can also be used.
hypervisor The hypervisor to use for the new virtual machine. Default is kvm.
host   The host to use for the new virtual machine, if this is omitted Salt will automatically detect what host to use.
seed   Set to False to prevent Salt from seeding the new virtual machine.
nic    The nic profile to use, defaults to the "default" nic profile which assumes a single network interface per VM associated with the "br0" bridge on the master.
install Set to False to prevent Salt from installing a minion on the new VM before it spins up.
disk   The disk profile to use
saltenv The Salt environment to use
enable_vnc Whether a VNC screen is attached to resulting VM. Default is False.
seed_cmd If seed is True, use this execution module function to seed new VM.  Default is seed.apply.
enable_qcow Clone disk image as a copy-on-write qcow2 image, using downloaded image as backing file.
serial_type Enable serial console. Set to 'pty' for serial console or 'tcp' for telnet.  Default is 'None'
salt.runners.virt.list(host=None, quiet=False, hyper=None) List the virtual machines on each host, this is a simplified query, showing only the virtual machine names belonging to each host.  A single host can be passed in to specify an individual host to list.
salt.runners.virt.migrate(name, target='') Migrate a VM from one host to another. This routine will just start the migration and display information on how to look up the progress.
salt.runners.virt.next_host() Return the host to use for the next autodeployed VM. This queries the available host and executes some math the determine the most "available" next host.
salt.runners.virt.pause(name) Pause the named VM
salt.runners.virt.purge(name, delete_key=True) Destroy the named VM
salt.runners.virt.query(host=None, quiet=False) Query the virtual machines. When called without options all hosts are detected and a full query is returned. A single host can be passed in to specify an individual host to query.
salt.runners.virt.reset(name) Force power down and restart an existing VM
salt.runners.virt.resume(name) Resume a paused VM
salt.runners.virt.start(name) Start a named virtual machine
salt.runners.virt.vm_info(name, quiet=False) Return the information on the named VM
salt.runners.vistara Vistara Runner
Runner to interact with the Vistara (http://www.vistarait.com/) REST API
codeauthor Brad Thurber <brad.thurber@gmail.com>
To use this runner, the Vistara client_id and Vistara oauth2 client_key and client_secret must be set in the master config.
For example /etc/salt/master.d/_vistara.conf:
vistara: client_id: client_012345 client_key: N0tReallyaR3alKeyButShouldB12345 client_secret: ThisI5AreallyLongsecretKeyIwonderwhyTheyMakethemSoBigTheseDays00
salt.runners.vistara.delete_device(name, safety_on=True) Deletes a device from Vistara based on DNS name or partial name. By default, delete_device will only perform the delete if a single host is returned. Set safety_on=False to delete all matches (up to default API search page size)
salt-run vistara.delete_device 'hostname-101.mycompany.com' salt-run vistara.delete_device 'hostname-101' salt-run vistara.delete_device 'hostname-1' safety_on=False
salt.runners.winrepo Runner to manage Windows software repo
salt.runners.winrepo.genrepo(opts=None, fire_event=True) Generate winrepo_cachefile based on sls files in the winrepo_dir
opts   Specify an alternate opts dict. Should not be used unless this function is imported into an execution module.
fire_event True Fire an event on failure. Only supported on the master.
salt-run winrepo.genrepo
salt.runners.winrepo.update_git_repos(opts=None, clean=False, masterless=False) Checkout git repos containing Windows Software Package Definitions
salt-run winrepo.update_git_repos salt-run winrepo.update_git_repos clean=True