neulab/tldr huggingface dataset:
salt.modules.ebuildpkg.upgrade(refresh=True, binhost=None, backtrack=3, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any emerge commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Run a full system upgrade (emerge -uDN @world)
salt.modules.ebuildpkg.upgrade_available(name, **kwargs) Check whether or not an upgrade is available for a given package
salt.modules.ebuildpkg.version(*names, **kwargs) Returns a string representing the package version or an empty string if not installed. If more than one package name is specified, a dict of name/version pairs is returned.
salt.modules.ebuildpkg.version_clean(version) Clean the version string removing extra data.
salt '*' pkg.version_clean <version_string>
salt.modules.ebuildpkg.version_cmp(pkg1, pkg2, **kwargs) Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem making the comparison.
salt '*' pkg.version_cmp '0.2.4-0' '0.2.4.1-0'
salt.modules.eix Support for Eix
salt.modules.eix.sync() Sync portage/overlay trees and update the eix database
salt '*' eix.sync
salt.modules.eix.update() Update the eix database
salt '*' eix.update
salt.modules.elasticsearch Elasticsearch - A distributed RESTful search and analytics server
Module to provide Elasticsearch compatibility to Salt (compatible with Elasticsearch version 1.5.2+)
configuration This module accepts connection configuration details either as parameters or as configuration settings in /etc/salt/minion on the relevant minions:
elasticsearch: host: '10.10.10.100:9200'
elasticsearch-cluster: hosts: - '10.10.10.100:9200' - '10.10.10.101:9200' - '10.10.10.102:9200'
elasticsearch-extra: hosts: - '10.10.10.100:9200' use_ssl: True verify_certs: True ca_certs: /path/to/custom_ca_bundle.pem number_of_shards: 1 number_of_replicas: 0 functions_blacklist: - 'saltutil.find_job' - 'pillar.items' - 'grains.items' proxies: - http: http://proxy:3128 - https: http://proxy:1080
When specifying proxies the requests backend will be used and the 'proxies' data structure is passed as-is to that module.
This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar.
Some functionality might be limited by elasticsearch-py and Elasticsearch server versions.
salt.modules.elasticsearch.alias_create(indices, alias, hosts=None, body=None, profile=None, source=None) Create an alias for a specific index/indices
indices Single or multiple indices separated by comma, use _all to perform the operation on all indices.
alias  Alias name
body   Optional definition such as routing or filter as defined in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html
source URL of file specifying optional definition such as routing or filter. Cannot be used in combination with body.
salt myminion elasticsearch.alias_create testindex_v1 testindex
salt.modules.elasticsearch.alias_delete(indices, aliases, hosts=None, body=None, profile=None, source=None) Delete an alias of an index
aliases Alias names separated by comma
salt myminion elasticsearch.alias_delete testindex_v1 testindex
salt.modules.elasticsearch.alias_exists(aliases, indices=None, hosts=None, profile=None) Return a boolean indicating whether given alias exists
salt myminion elasticsearch.alias_exists None testindex
salt.modules.elasticsearch.alias_get(indices=None, aliases=None, hosts=None, profile=None) Check for the existence of an alias and if it exists, return it
salt myminion elasticsearch.alias_get testindex
salt.modules.elasticsearch.cluster_get_settings(flat_settings=False, include_defaults=False, hosts=None, profile=None) New in version 3000.
Return Elasticsearch cluster settings.
flat_settings Return settings in flat format.
include_defaults Whether to return all default clusters setting.
salt myminion elasticsearch.cluster_get_settings
salt.modules.elasticsearch.cluster_health(index=None, level='cluster', local=False, hosts=None, profile=None) New in version 2017.7.0.
Return Elasticsearch cluster health.
index  Limit the information returned to a specific index
level  Specify the level of detail for returned information, default 'cluster', valid choices are: 'cluster', 'indices', 'shards'
local  Return local information, do not retrieve the state from master node
salt myminion elasticsearch.cluster_health
salt.modules.elasticsearch.cluster_put_settings(body=None, flat_settings=False, hosts=None, profile=None) New in version 3000.
Set Elasticsearch cluster settings.
body   The settings to be updated. Can be either 'transient' or 'persistent' (survives cluster restart) http://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html
salt myminion elasticsearch.cluster_put_settings '{"persistent": {"indices.recovery.max_bytes_per_sec": "50mb"}}' salt myminion elasticsearch.cluster_put_settings '{"transient": {"indices.recovery.max_bytes_per_sec": "50mb"}}'
salt.modules.elasticsearch.cluster_stats(nodes=None, hosts=None, profile=None) New in version 2017.7.0.
Return Elasticsearch cluster stats.
nodes  List of cluster nodes (id or name) to display stats for. Use _local for connected node, empty for all
salt myminion elasticsearch.cluster_stats
salt.modules.elasticsearch.document_create(index, doc_type, body=None, id=None, hosts=None, profile=None, source=None) Create a document in a specified index
index  Index name where the document should reside
doc_type Type of the document
body   Document to store
source URL of file specifying document to store. Cannot be used in combination with body.
id     Optional unique document identifier for specified doc_type (empty for random)
salt myminion elasticsearch.document_create testindex doctype1 '{}'
salt.modules.elasticsearch.document_delete(index, doc_type, id, hosts=None, profile=None) Delete a document from an index
index  Index name where the document resides
id     Document identifier
salt myminion elasticsearch.document_delete testindex doctype1 AUx-384m0Bug_8U80wQZ
salt.modules.elasticsearch.document_exists(index, id, doc_type='_all', hosts=None, profile=None) Return a boolean indicating whether given document exists
doc_type Type of the document, use _all to fetch the first document matching the ID across all types
salt myminion elasticsearch.document_exists testindex AUx-384m0Bug_8U80wQZ
salt.modules.elasticsearch.document_get(index, id, doc_type='_all', hosts=None, profile=None) Check for the existence of a document and if it exists, return it
salt myminion elasticsearch.document_get testindex AUx-384m0Bug_8U80wQZ
salt.modules.elasticsearch.flush_synced(hosts=None, profile=None, **kwargs) New in version 3000.
Perform a normal flush, then add a generated unique marker (sync_id) to all shards. http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-synced-flush.html
index  (Optional, string) A comma-separated list of index names; use _all or empty string for all indices. Defaults to '_all'.
ignore_unavailable (Optional, boolean) If true, missing or closed indices are not included in the response. Defaults to false.
allow_no_indices (Optional, boolean) If true, the request does not return an error if a wildcard expression or _all value retrieves only missing or closed indices.  This parameter also applies to index aliases that point to a missing or closed index.
expand_wildcards (Optional, string) Controls what kind of indices that wildcard expressions can expand to.
Valid values are:
all - Expand to open and closed indices. open - Expand only to open indices. closed - Expand only to closed indices. none - Wildcard expressions are not accepted.
The defaults settings for the above parameters depend on the API being used.
salt myminion elasticsearch.flush_synced index='index1,index2' ignore_unavailable=True allow_no_indices=True expand_wildcards='all'
salt.modules.elasticsearch.index_close(index, allow_no_indices=True, expand_wildcards='open', ignore_unavailable=True, hosts=None, profile=None) New in version 2017.7.0.
Close specified index.
index  Index to be closed
allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all string or when no indices have been specified)
expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both., default ‘open’, valid choices are: ‘open’, ‘closed’, ‘none’, ‘all’
ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
salt myminion elasticsearch.index_close testindex
salt.modules.elasticsearch.index_create(index, body=None, hosts=None, profile=None, source=None) Create an index
index  Index name
body   Index definition, such as settings and mappings as defined in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html
source URL to file specifying index definition. Cannot be used in combination with body.
salt myminion elasticsearch.index_create testindex salt myminion elasticsearch.index_create testindex2 '{"settings" : {"index" : {"number_of_shards" : 3, "number_of_replicas" : 2}}}'
salt.modules.elasticsearch.index_delete(index, hosts=None, profile=None) Delete an index
salt myminion elasticsearch.index_delete testindex
salt.modules.elasticsearch.index_exists(index, hosts=None, profile=None) Return a boolean indicating whether given index exists
salt myminion elasticsearch.index_exists testindex
salt.modules.elasticsearch.index_get(index, hosts=None, profile=None) Check for the existence of an index and if it exists, return it
salt myminion elasticsearch.index_get testindex
salt.modules.elasticsearch.index_get_settings(hosts=None, profile=None, **kwargs) New in version 3000.
Check for the existence of an index and if it exists, return its settings http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html
name   (Optional, string) The name of the settings that should be included
allow_no_indices (Optional, boolean) Whether to ignore if a wildcard indices expression resolves into no concrete indices.  (This includes _all string or when no indices have been specified)
expand_wildcards (Optional, string) Whether to expand wildcard expression to concrete indices that are open, closed or both.  Valid choices are: ‘open’, ‘closed’, ‘none’, ‘all’
flat_settings (Optional, boolean) Return settings in flat format
ignore_unavailable (Optional, boolean) Whether specified concrete indices should be ignored when unavailable (missing or closed)
include_defaults (Optional, boolean) Whether to return all default setting for each of the indices.
local  (Optional, boolean) Return local information, do not retrieve the state from master node
The defaults settings for the above parameters depend on the API version being used.
salt myminion elasticsearch.index_get_settings index=testindex
salt.modules.elasticsearch.index_open(index, allow_no_indices=True, expand_wildcards='closed', ignore_unavailable=True, hosts=None, profile=None) New in version 2017.7.0.
Open specified index.
index  Index to be opened
expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both., default ‘closed’, valid choices are: ‘open’, ‘closed’, ‘none’, ‘all’
salt myminion elasticsearch.index_open testindex
salt.modules.elasticsearch.index_put_settings(body=None, hosts=None, profile=None, source=None, **kwargs) New in version 3000.
Update existing index settings https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html
body   The index settings to be updated.
index  (Optional, string) A comma-separated list of index names; use _all or empty string to perform the operation on all indices
flat_settings (Optional, boolean) Return settings in flat format (default: false)
master_timeout (Optional, time units) Explicit operation timeout for connection to master node
preserve_existing (Optional, boolean) Whether to update existing settings. If set to true existing settings on an index remain unchanged, the default is false
NOTE: Elasticsearch time units can be found here: https://www.elastic.co/guide/en/elasticsearch/reference/current/common-options.html#time-units
salt myminion elasticsearch.index_put_settings index=testindex body='{"settings" : {"index" : {"number_of_replicas" : 2}}}'
salt.modules.elasticsearch.index_template_create(name, body=None, hosts=None, profile=None, source=None) Create an index template
name   Index template name
body   Template definition as specified in http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html
source URL to file specifying template definition. Cannot be used in combination with body.
salt myminion elasticsearch.index_template_create testindex_templ '{ "template": "logstash-*", "order": 1, "settings": { "number_of_shards": 1 } }'
salt.modules.elasticsearch.index_template_delete(name, hosts=None, profile=None) Delete an index template (type) along with its data
salt myminion elasticsearch.index_template_delete testindex_templ user
salt.modules.elasticsearch.index_template_exists(name, hosts=None, profile=None) Return a boolean indicating whether given index template exists
salt myminion elasticsearch.index_template_exists testindex_templ
salt.modules.elasticsearch.index_template_get(name, hosts=None, profile=None) Retrieve template definition of index or index/type
salt myminion elasticsearch.index_template_get testindex_templ
salt.modules.elasticsearch.info(hosts=None, profile=None) New in version 2017.7.0.
Return Elasticsearch information.
salt myminion elasticsearch.info salt myminion elasticsearch.info profile=elasticsearch-extra
salt.modules.elasticsearch.mapping_create(index, doc_type, body=None, hosts=None, profile=None, source=None) Create a mapping in a given index
index  Index for the mapping
doc_type Name of the document type
body   Mapping definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html
source URL to file specifying mapping definition. Cannot be used in combination with body.
salt myminion elasticsearch.mapping_create testindex user '{ "user" : { "properties" : { "message" : {"type" : "string", "store" : true } } } }'
salt.modules.elasticsearch.mapping_delete(index, doc_type, hosts=None, profile=None) Delete a mapping (type) along with its data. As of Elasticsearch 5.0 this is no longer available.
salt myminion elasticsearch.mapping_delete testindex user
salt.modules.elasticsearch.mapping_get(index, doc_type, hosts=None, profile=None) Retrieve mapping definition of index or index/type
salt myminion elasticsearch.mapping_get testindex user
salt.modules.elasticsearch.node_info(nodes=None, flat_settings=False, hosts=None, profile=None) New in version 2017.7.0.
Return Elasticsearch node information.
flat_settings Flatten settings keys
salt myminion elasticsearch.node_info flat_settings=True
salt.modules.elasticsearch.ping(allow_failure=False, hosts=None, profile=None) New in version 2017.7.0.
Test connection to Elasticsearch instance. This method does not fail if not explicitly specified.
allow_failure Throw exception if ping fails
salt myminion elasticsearch.ping allow_failure=True salt myminion elasticsearch.ping profile=elasticsearch-extra
salt.modules.elasticsearch.pipeline_create(id, body, hosts=None, profile=None) New in version 2017.7.0.
Create Ingest pipeline by supplied definition. Available since Elasticsearch 5.0.
id     Pipeline id
body   Pipeline definition as specified in https://www.elastic.co/guide/en/elasticsearch/reference/master/pipeline.html
salt myminion elasticsearch.pipeline_create mypipeline '{"description": "my custom pipeline", "processors": [{"set" : {"field": "collector_timestamp_millis", "value": "{{_ingest.timestamp}}"}}]}'
salt.modules.elasticsearch.pipeline_delete(id, hosts=None, profile=None) New in version 2017.7.0.
Delete Ingest pipeline. Available since Elasticsearch 5.0.
salt myminion elasticsearch.pipeline_delete mypipeline
salt.modules.elasticsearch.pipeline_get(id, hosts=None, profile=None) New in version 2017.7.0.
Retrieve Ingest pipeline definition. Available since Elasticsearch 5.0.
salt myminion elasticsearch.pipeline_get mypipeline
salt.modules.elasticsearch.pipeline_simulate(id, body, verbose=False, hosts=None, profile=None) New in version 2017.7.0.
Simulate existing Ingest pipeline on provided data. Available since Elasticsearch 5.0.
verbose Specify if the output should be more verbose
salt myminion elasticsearch.pipeline_simulate mypipeline '{"docs":[{"_index":"index","_type":"type","_id":"id","_source":{"foo":"bar"}},{"_index":"index","_type":"type","_id":"id","_source":{"foo":"rab"}}]}' verbose=True
salt.modules.elasticsearch.repository_create(name, body, hosts=None, profile=None) New in version 2017.7.0.
Create repository for storing snapshots. Note that shared repository paths have to be specified in path.repo Elasticsearch configuration option.
name   Repository name
body   Repository definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html
salt myminion elasticsearch.repository_create testrepo '{"type":"fs","settings":{"location":"/tmp/test","compress":true}}'
salt.modules.elasticsearch.repository_delete(name, hosts=None, profile=None) New in version 2017.7.0.
Delete existing repository.
salt myminion elasticsearch.repository_delete testrepo
salt.modules.elasticsearch.repository_get(name, local=False, hosts=None, profile=None) New in version 2017.7.0.
Get existing repository details.
local  Retrieve only local information, default is false
salt myminion elasticsearch.repository_get testrepo
salt.modules.elasticsearch.repository_verify(name, hosts=None, profile=None) New in version 2017.7.0.
Obtain list of cluster nodes which successfully verified this repository.
salt myminion elasticsearch.repository_verify testrepo
salt.modules.elasticsearch.search_template_create(id, body, hosts=None, profile=None) New in version 2017.7.0.
Create search template by supplied definition
id     Template ID
body   Search template definition
salt myminion elasticsearch.search_template_create mytemplate '{"template":{"query":{"match":{"title":"{{query_string}}"}}}}'
salt.modules.elasticsearch.search_template_delete(id, hosts=None, profile=None) New in version 2017.7.0.
Delete existing search template definition.
salt myminion elasticsearch.search_template_delete mytemplate
salt.modules.elasticsearch.search_template_get(id, hosts=None, profile=None) New in version 2017.7.0.
Obtain existing search template definition.
salt myminion elasticsearch.search_template_get mytemplate
salt.modules.elasticsearch.snapshot_create(repository, snapshot, body=None, hosts=None, profile=None) New in version 2017.7.0.
Create snapshot in specified repository by supplied definition.
repository Repository name
snapshot Snapshot name
body   Snapshot definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html
salt myminion elasticsearch.snapshot_create testrepo testsnapshot '{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":false}'
salt.modules.elasticsearch.snapshot_delete(repository, snapshot, hosts=None, profile=None) New in version 2017.7.0.
Delete snapshot from specified repository.
salt myminion elasticsearch.snapshot_delete testrepo testsnapshot
salt.modules.elasticsearch.snapshot_get(repository, snapshot, ignore_unavailable=False, hosts=None, profile=None) New in version 2017.7.0.
Obtain snapshot residing in specified repository.
snapshot Snapshot name, use _all to obtain all snapshots in specified repository
ignore_unavailable Ignore unavailable snapshots
salt myminion elasticsearch.snapshot_get testrepo testsnapshot
salt.modules.elasticsearch.snapshot_restore(repository, snapshot, body=None, hosts=None, profile=None) New in version 2017.7.0.
Restore existing snapshot in specified repository by supplied definition.
body   Restore definition as in https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html
salt myminion elasticsearch.snapshot_restore testrepo testsnapshot '{"indices":"index_1,index_2","ignore_unavailable":true,"include_global_state":true}'
salt.modules.elasticsearch.snapshot_status(repository=None, snapshot=None, ignore_unavailable=False, hosts=None, profile=None) New in version 2017.7.0.
Obtain status of all currently running snapshots.
repository Particular repository to look for snapshots
salt myminion elasticsearch.snapshot_status ignore_unavailable=True
salt.modules.environ Support for getting and setting the environment variables of the current salt process.
salt.modules.environ.get(key, default='') Get a single salt process environment variable.
key    String used as the key for environment lookup.
default If the key is not found in the environment, return this value.  Default: ''
salt '*' environ.get foo salt '*' environ.get baz default=False
salt.modules.environ.has_value(key, value=None) Determine whether the key exists in the current salt process environment dictionary. Optionally compare the current value of the environment against the supplied value string.
key    Must be a string. Used as key for environment lookup.
value: Optional. If key exists in the environment, compare the current value with this value. Return True if they are equal.
salt '*' environ.has_value foo
salt.modules.environ.item(keys, default='') Get one or more salt process environment variables.  Returns a dict.
keys   Either a string or a list of strings that will be used as the keys for environment lookup.
salt '*' environ.item foo salt '*' environ.item '[foo, baz]' default=None
salt.modules.environ.items() Return a dict of the entire environment set for the salt process
salt '*' environ.items
salt.modules.environ.setenv(environ, false_unsets=False, clear_all=False, update_minion=False, permanent=False) Set multiple salt process environment variables from a dict. Returns a dict.
environ Must be a dict. The top-level keys of the dict are the names of the environment variables to set. Each key's value must be a string or False. Refer to the 'false_unsets' parameter for behavior when a value set to False.
false_unsets If a key's value is False and false_unsets is True, then the key will be removed from the salt processes environment dict entirely. If a key's value is False and false_unsets is not True, then the key's value will be set to an empty string.  Default: False
clear_all USE WITH CAUTION! This option can unset environment variables needed for salt to function properly.  If clear_all is True, then any environment variables not defined in the environ dict will be deleted.  Default: False
update_minion If True, apply these environ changes to the main salt-minion process. If False, the environ changes will only affect the current salt subprocess.  Default: False
permanent On Windows minions this will set the environment variable in the registry so that it is always added as an environment variable when applications open. If you want to set the variable to HKLM instead of HKCU just pass in "HKLM" for this parameter. On all other minion types this will be ignored. Note: This will only take affect on applications opened after this has been set.
salt '*' environ.setenv '{"foo": "bar", "baz": "quux"}' salt '*' environ.setenv '{"a": "b", "c": False}' false_unsets=True
salt.modules.environ.setval(key, val, false_unsets=False, permanent=False) Set a single salt process environment variable. Returns True on success.
key    The environment key to set. Must be a string.
val    The value to set. Must be a string or False. Refer to the 'false_unsets' parameter for behavior when set to False.
false_unsets If val is False and false_unsets is True, then the key will be removed from the salt processes environment dict entirely.  If val is False and false_unsets is not True, then the key's value will be set to an empty string. Default: False.
salt '*' environ.setval foo bar salt '*' environ.setval baz val=False false_unsets=True salt '*' environ.setval baz bar permanent=True salt '*' environ.setval baz bar permanent=HKLM
salt.modules.eselect Support for eselect, Gentoo's configuration and management tool.
salt.modules.eselect.exec_action(module, action, module_parameter=None, action_parameter=None, state_only=False) Execute an arbitrary action on a module.
module name of the module to be executed
action name of the module's action to be run
module_parameter additional params passed to the defined module
action_parameter additional params passed to the defined action
state_only don't return any output but only the success/failure of the operation
CLI Example (updating the php implementation used for apache2):
salt '*' eselect.exec_action php update action_parameter='apache2'
salt.modules.eselect.get_current_target(module, module_parameter=None, action_parameter=None) Get the currently selected target for the given module.
module name of the module to be queried for its current target
action_parameter additional params passed to the 'show' action
CLI Example (current target of system-wide java-vm):
salt '*' eselect.get_current_target java-vm action_parameter='system'
CLI Example (current target of kernel symlink):
salt '*' eselect.get_current_target kernel
salt.modules.eselect.get_modules() List available eselect modules.
salt '*' eselect.get_modules
salt.modules.eselect.get_target_list(module, action_parameter=None) List available targets for the given module.
module name of the module to be queried for its targets
salt '*' eselect.get_target_list kernel
salt.modules.eselect.set_target(module, target, module_parameter=None, action_parameter=None) Set the target for the given module.  Target can be specified by index or name.
module name of the module for which a target should be set
target name of the target to be set for this module
CLI Example (setting target of system-wide java-vm):
salt '*' eselect.set_target java-vm icedtea-bin-7 action_parameter='system'
CLI Example (setting target of kernel symlink):
salt '*' eselect.set_target kernel linux-3.17.5-gentoo
salt.modules.esxcluster Module used to access the esxcluster proxy connection methods
salt.modules.esxcluster.get_details()
salt.modules.esxdatacenter Module used to access the esxdatacenter proxy connection methods
salt.modules.esxdatacenter.get_details()
salt.modules.esxi Glues the VMware vSphere Execution Module to the VMware ESXi Proxy Minions to the esxi proxymodule.
Depends: vSphere Remote Execution Module (salt.modules.vsphere)
For documentation on commands that you can direct to an ESXi host via proxy, look in the documentation for salt.modules.vsphere.
This execution module calls through to a function in the ESXi proxy module called ch_config, which looks up the function passed in the command parameter in salt.modules.vsphere and calls it.
To execute commands with an ESXi Proxy Minion using the vSphere Execution Module, use the esxi.cmd <vsphere-function-name> syntax. Both args and kwargs needed for various vsphere execution module functions must be passed through in a kwarg- type manor.
salt 'esxi-proxy' esxi.cmd system_info salt 'exsi-proxy' esxi.cmd get_service_policy service_name='ssh'
salt.modules.esxi.cmd(command, *args, **kwargs)
salt.modules.esxi.get_details()
salt.modules.esxvm Module used to access the esx proxy connection methods
salt.modules.esxvm.get_details()
salt.modules.etcd_mod Execution module to work with etcd
Configuration To work with an etcd server you must configure an etcd profile. The etcd config can be set in either the Salt Minion configuration file or in pillar:
my_etd_config: etcd.host: 127.0.0.1 etcd.port: 4001
etcd.host: 127.0.0.1 etcd.port: 4001
NOTE: The etcd configuration can also be set in the Salt Master config file, but in order to use any etcd configurations defined in the Salt Master config, the pillar_opts must be set to True.
Be aware that setting pillar_opts to True has security implications as this makes all master configuration settings available in all minion's pillars.
salt.modules.etcd_mod.get_(key, recurse=False, profile=None, **kwargs) New in version 2014.7.0.
Get a value from etcd, by direct path.  Returns None on failure.
salt myminion etcd.get /path/to/key salt myminion etcd.get /path/to/key profile=my_etcd_config salt myminion etcd.get /path/to/key recurse=True profile=my_etcd_config salt myminion etcd.get /path/to/key host=127.0.0.1 port=2379
salt.modules.etcd_mod.ls_(path='/', profile=None, **kwargs) New in version 2014.7.0.
Return all keys and dirs inside a specific path. Returns an empty dict on failure.
salt myminion etcd.ls /path/to/dir/ salt myminion etcd.ls /path/to/dir/ profile=my_etcd_config salt myminion etcd.ls /path/to/dir/ host=127.0.0.1 port=2379
salt.modules.etcd_mod.rm_(key, recurse=False, profile=None, **kwargs) New in version 2014.7.0.
Delete a key from etcd.  Returns True if the key was deleted, False if it was not and None if there was a failure.
salt myminion etcd.rm /path/to/key salt myminion etcd.rm /path/to/key profile=my_etcd_config salt myminion etcd.rm /path/to/key host=127.0.0.1 port=2379 salt myminion etcd.rm /path/to/dir recurse=True profile=my_etcd_config
salt.modules.etcd_mod.set_(key, value, profile=None, ttl=None, directory=False, **kwargs) New in version 2014.7.0.
Set a key in etcd by direct path. Optionally, create a directory or set a TTL on the key.  Returns None on failure.
salt myminion etcd.set /path/to/key value salt myminion etcd.set /path/to/key value profile=my_etcd_config salt myminion etcd.set /path/to/key value host=127.0.0.1 port=2379 salt myminion etcd.set /path/to/dir '' directory=True salt myminion etcd.set /path/to/key value ttl=5
salt.modules.etcd_mod.tree(path='/', profile=None, **kwargs) New in version 2014.7.0.
Recurse through etcd and return all values.  Returns None on failure.
salt myminion etcd.tree salt myminion etcd.tree profile=my_etcd_config salt myminion etcd.tree host=127.0.0.1 port=2379 salt myminion etcd.tree /path/to/keys profile=my_etcd_config
salt.modules.etcd_mod.update(fields, path='', profile=None, **kwargs) New in version 2016.3.0.
Sets a dictionary of values in one call.  Useful for large updates in syndic environments.  The dictionary can contain a mix of formats such as:
{ '/some/example/key': 'bar', '/another/example/key': 'baz' }
Or it may be a straight dictionary, which will be flattened to look like the above format:
{ 'some': { 'example': { 'key': 'bar' } }, 'another': { 'example': { 'key': 'baz' } } }
You can even mix the two formats and it will be flattened to the first format.  Leading and trailing '/' will be removed.
Empty directories can be created by setting the value of the key to an empty dictionary.
The 'path' parameter will optionally set the root of the path to use.
salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" profile=my_etcd_config salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" host=127.0.0.1 port=2379 salt myminion etcd.update "{'/path/to/key': 'baz', '/another/key': 'bar'}" path='/some/root'
salt.modules.etcd_mod.watch(key, recurse=False, profile=None, timeout=0, index=None, **kwargs) New in version 2016.3.0.
Makes a best effort to watch for a key or tree change in etcd. Returns a dict containing the new key value ( or None if the key was deleted ), the modifiedIndex of the key, whether the key changed or not, the path to the key that changed and whether it is a directory or not.
If something catastrophic happens, returns {}
salt myminion etcd.watch /path/to/key salt myminion etcd.watch /path/to/key timeout=10 salt myminion etcd.watch /patch/to/key profile=my_etcd_config index=10 salt myminion etcd.watch /patch/to/key host=127.0.0.1 port=2379
salt.modules.ethtool Module for running ethtool command
codeauthor Krzysztof Pawlowski <msciciel@msciciel.eu>
depends python-ethtool
salt.modules.ethtool.set_coalesce(devname, **kwargs) Changes the coalescing settings of the specified network device
salt '*' ethtool.set_coalesce <devname> [adaptive_rx=on|off] [adaptive_tx=on|off] [rx_usecs=N] [rx_frames=N] [rx_usecs_irq=N] [rx_frames_irq=N] [tx_usecs=N] [tx_frames=N] [tx_usecs_irq=N] [tx_frames_irq=N] [stats_block_usecs=N] [pkt_rate_low=N] [rx_usecs_low=N] [rx_frames_low=N] [tx_usecs_low=N] [tx_frames_low=N] [pkt_rate_high=N] [rx_usecs_high=N] [rx_frames_high=N] [tx_usecs_high=N] [tx_frames_high=N] [sample_interval=N]
salt.modules.ethtool.set_offload(devname, **kwargs) Changes the offload parameters and other features of the specified network device
salt '*' ethtool.set_offload <devname> tcp_segmentation_offload=on
salt.modules.ethtool.set_ring(devname, **kwargs) Changes the rx/tx ring parameters of the specified network device
salt '*' ethtool.set_ring <devname> [rx=N] [rx_mini=N] [rx_jumbo=N] [tx=N]
salt.modules.ethtool.show_coalesce(devname) Queries the specified network device for coalescing information
salt '*' ethtool.show_coalesce <devname>
salt.modules.ethtool.show_driver(devname) Queries the specified network device for associated driver information
salt '*' ethtool.show_driver <devname>
salt.modules.ethtool.show_offload(devname) Queries the specified network device for the state of protocol offload and other features
salt '*' ethtool.show_offload <devname>
salt.modules.ethtool.show_ring(devname) Queries the specified network device for rx/tx ring parameter information
salt '*' ethtool.show_ring <devname>
salt.modules.event Use the Salt Event System to fire events from the master to the minion and vice-versa.
salt.modules.event.fire(data, tag) Fire an event on the local minion event bus. Data must be formed as a dict.
salt '*' event.fire '{"data":"my event data"}' 'tag'
salt.modules.event.fire_master(data, tag, preload=None) Fire an event off up to the master server
salt '*' event.fire_master '{"data":"my event data"}' 'tag'
salt.modules.event.send(tag, data=None, preload=None, with_env=False, with_grains=False, with_pillar=False, with_env_opts=False, **kwargs) Send an event to the Salt Master
• tag -- A tag to give the event.  Use slashes to create a namespace for related events. E.g., myco/build/buildserver1/start, myco/build/buildserver1/success, myco/build/buildserver1/failure.
• data -- A dictionary of data to send in the event.  This is free-form. Send any data points that are needed for whoever is consuming the event. Arguments on the CLI are interpreted as YAML so complex data structures are possible.
• with_env (Specify True to include all environment variables, or specify a list of strings of variable names to include.) -- Include environment variables from the current shell environment in the event data as environ.. This is a short-hand for working with systems that seed the environment with relevant data such as Jenkins.
• with_grains (Specify True to include all grains, or specify a list of strings of grain names to include.) -- Include grains from the current minion in the event data as grains.
• with_pillar (Specify True to include all Pillar values, or specify a list of strings of Pillar keys to include. It is a best-practice to only specify a relevant subset of Pillar data.) -- Include Pillar values from the current minion in the event data as pillar. Remember Pillar data is often sensitive data so be careful. This is useful for passing ephemeral Pillar values through an event. Such as passing the pillar={} kwarg in state.sls from the Master, through an event on the Minion, then back to the Master.
• with_env_opts (Specify True to include saltenv and pillarenv values or False to omit them.) -- Include saltenv and pillarenv set on minion at the moment when event is send into event data.
• kwargs -- Any additional keyword arguments passed to this function will be interpreted as key-value pairs and included in the event data.  This provides a convenient alternative to YAML for simple values.
salt-call event.send myco/mytag foo=Foo bar=Bar salt-call event.send 'myco/mytag' '{foo: Foo, bar: Bar}'
A convenient way to allow Jenkins to execute salt-call is via sudo. The following rule in sudoers will allow the jenkins user to run only the following command.
/etc/sudoers (allow preserving the environment):
jenkins ALL=(ALL) NOPASSWD:SETENV: /usr/bin/salt-call event.send*
Call Jenkins via sudo (preserve the environment):
sudo -E salt-call event.send myco/jenkins/build/success with_env=[BUILD_ID, BUILD_URL, GIT_BRANCH, GIT_COMMIT]
salt.modules.extfs Module for managing ext2/3/4 file systems
salt.modules.extfs.attributes(device, args=None) Return attributes from dumpe2fs for a specified device
salt '*' extfs.attributes /dev/sda1
salt.modules.extfs.blocks(device, args=None) Return block and inode info from dumpe2fs for a specified device
salt '*' extfs.blocks /dev/sda1
salt.modules.extfs.dump(device, args=None) Return all contents of dumpe2fs for a specified device
salt '*' extfs.dump /dev/sda1
salt.modules.extfs.mkfs(device, fs_type, **kwargs) Create a file system on the specified device
salt '*' extfs.mkfs /dev/sda1 fs_type=ext4 opts='acl,noexec'
• block_size: 1024, 2048 or 4096
• check: check for bad blocks
• direct: use direct IO
• ext_opts: extended file system options (comma-separated)
• fragment_size: size of fragments
• force: setting force to True will cause mke2fs to specify the -F option twice (it is already set once); this is truly dangerous
• blocks_per_group: number of blocks in a block group
• number_of_groups: ext4 option for a virtual block group
• bytes_per_inode: set the bytes/inode ratio
• inode_size: size of the inode
• journal: set to True to create a journal (default on ext3/4)
• journal_opts: options for the fs journal (comma separated)
• blocks_file: read bad blocks from file
• label: label to apply to the file system
• reserved: percentage of blocks reserved for super-user
• last_dir: last mounted directory
• test: set to True to not actually create the file system (mke2fs -n)
• number_of_inodes: override default number of inodes
• creator_os: override "creator operating system" field
• opts: mount options (comma separated)
• revision: set the filesystem revision (default 1)
• super: write superblock and group descriptors only
• fs_type: set the filesystem type (REQUIRED)
• usage_type: how the filesystem is going to be used
• uuid: set the UUID for the file system
See the mke2fs(8) manpage for a more complete description of these options.
salt.modules.extfs.tune(device, **kwargs) Set attributes for the specified device (using tune2fs)
salt '*' extfs.tune /dev/sda1 force=True label=wildstallyns opts='acl,noexec'
• max: max mount count
• count: mount count
• error: error behavior
• extended_opts: extended options (comma separated)
• force: force, even if there are errors (set to True)
• group: group name or gid that can use the reserved blocks
• interval: interval between checks
• feature: set or clear a feature (comma separated)
• mmp_check: mmp check interval
• reserved: reserved blocks count
• quota_opts: quota options (comma separated)
• time: time last checked
• user: user or uid who can use the reserved blocks
salt.modules.file Manage information about regular files, directories, and special files on the minion, set/read user, group, mode, and data
class salt.modules.file.AttrChanges(added, removed)
added  Alias for field number 0
removed Alias for field number 1
salt.modules.file.access(path, mode) New in version 2014.1.0.
Test whether the Salt process has the specified access to the file. One of the following modes must be specified:
f: Test the existence of the path r: Test the readability of the path w: Test the writability of the path x: Test whether the path can be executed
salt '*' file.access /path/to/file f salt '*' file.access /path/to/file x
salt.modules.file.append(path, *args, **kwargs) New in version 0.9.5.
Append text to the end of a file
path   path to file
*args  strings to append to file
salt '*' file.append /etc/motd \ "With all thine offerings thou shalt offer salt." \ "Salt is what makes things taste bad when it isn't in them."
If you need to pass a string to append and that string contains an equal sign, you must include the argument name, args.  For example:
salt '*' file.append /etc/motd args='cheese=spam'
salt '*' file.append /etc/motd args="['cheese=spam','spam=cheese']"
salt.modules.file.apply_template_on_contents(contents, template, context, defaults, saltenv) Return the contents after applying the templating engine
contents template string
context Overrides default context variables passed to the template.
defaults Default context passed to the template.
salt '*' file.apply_template_on_contents \ contents='This is a {{ template }} string.' \ template=jinja \ "context={}" "defaults={'template': 'cool'}" \ saltenv=base
salt.modules.file.basename(path) Returns the final component of a pathname
This can be useful at the CLI but is frequently useful when scripting.
{%- set filename = salt['file.basename'](source_file) %}
salt '*' file.basename 'test/test.config'
salt.modules.file.blockreplace(path, marker_start='#-- start managed zone --', marker_end='#-- end managed zone --', content='', append_if_not_found=False, prepend_if_not_found=False, backup='.bak', dry_run=False, show_changes=True, append_newline=False, insert_before_match=None, insert_after_match=None) New in version 2014.1.0.
Replace content of a text block in a file, delimited by line markers
A block of content delimited by comments can help you manage several lines entries without worrying about old entries removal.
NOTE: This function will store two copies of the file in-memory (the original version and the edited version) in order to detect changes and only edit the targeted file if necessary.
path   Filesystem path to the file to be edited
marker_start The line content identifying a line as the start of the content block.  Note that the whole line containing this marker will be considered, so whitespace or extra content before or after the marker is included in final output
marker_end The line content identifying the end of the content block. As of versions 2017.7.5 and 2018.3.1, everything up to the text matching the marker will be replaced, so it's important to ensure that your marker includes the beginning of the text you wish to replace.
content The content to be used between the two lines identified by marker_start and marker_stop.
append_if_not_found: False If markers are not found and set to True then, the markers and content will be appended to the file.
prepend_if_not_found: False If markers are not found and set to True then, the markers and content will be prepended to the file.
insert_before_match If markers are not found, this parameter can be set to a regex which will insert the block before the first found occurrence in the file.
insert_after_match If markers are not found, this parameter can be set to a regex which will insert the block after the first found occurrence in the file.
backup The file extension to use for a backup of the file if any edit is made.  Set to False to skip making a backup.
dry_run: False If True, do not make any edits to the file and simply return the changes that would be made.
show_changes: True Controls how changes are presented. If True, this function will return a unified diff of the changes made. If False, then it will return a boolean (True if any changes were made, otherwise False).
append_newline: False Controls whether or not a newline is appended to the content block. If the value of this argument is True then a newline will be added to the content block. If it is False, then a newline will not be added to the content block. If it is None then a newline will only be added to the content block if it does not already end in a newline.
Changed in version 2017.7.5,2018.3.1: New behavior added when value is None.
Changed in version 2019.2.0: The default value of this argument will change to None to match the behavior of the file.blockreplace state
salt '*' file.blockreplace /etc/hosts '#-- start managed zone foobar : DO NOT EDIT --' \ '#-- end managed zone foobar --' $'10.0.1.1 foo.foobar\n10.0.1.2 bar.foobar' True
salt.modules.file.chattr(*files, **kwargs) New in version 2018.3.0.
Change the attributes of files. This function accepts one or more files and the following options:
operator Can be wither add or remove. Determines whether attributes should be added or removed from files
attributes One or more of the following characters: aAcCdDeijPsStTu, representing attributes to add to/remove from files
version a version number to assign to the file(s)
flags  One or more of the following characters: RVf, representing flags to assign to chattr (recurse, verbose, suppress most errors)
salt '*' file.chattr foo1.txt foo2.txt operator=add attributes=ai salt '*' file.chattr foo3.txt operator=remove attributes=i version=2
salt.modules.file.check_file_meta(name, sfn, source, source_sum, user, group, mode, attrs, saltenv, contents=None, seuser=None, serole=None, setype=None, serange=None, verify_ssl=True) Check for the changes in the file metadata.
salt '*' file.check_file_meta /etc/httpd/conf.d/httpd.conf None salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root root '755' None base
NOTE: Supported hash types include sha512, sha384, sha256, sha224, sha1, and md5.
name   Path to file destination
sfn    Template-processed source file contents
source URL to file source
source_sum File checksum information as a dictionary
{hash_type: md5, hsum: <md5sum>}
user   Destination file user owner
group  Destination file group owner
mode   Destination file permissions mode
attrs  Destination file attributes
saltenv Salt environment used to resolve source files
contents File contents
seuser selinux user attribute
serole selinux role attribute
setype selinux type attribute
serange selinux range attribute
verify_ssl If False, remote https file sources (https://) will not attempt to validate the servers certificate. Default is True.
salt.modules.file.check_hash(path, file_hash) Check if a file matches the given hash string
Returns True if the hash matches, otherwise False.
path   Path to a file local to the minion.
hash   The hash to check against the file specified in the path argument.
Changed in version 2016.11.4.
For this and newer versions the hash can be specified without an accompanying hash type (e.g. e138491e9d5b97023cea823fe17bac22), but for earlier releases it is necessary to also specify the hash type in the format <hash_type>=<hash_value> (e.g. md5=e138491e9d5b97023cea823fe17bac22).
salt '*' file.check_hash /etc/fstab e138491e9d5b97023cea823fe17bac22 salt '*' file.check_hash /etc/fstab md5=e138491e9d5b97023cea823fe17bac22
salt.modules.file.check_managed(name, source, source_hash, source_hash_name, user, group, mode, attrs, template, context, defaults, saltenv, contents=None, skip_verify=False, seuser=None, serole=None, setype=None, serange=None, **kwargs) Check to see what changes need to be made for a file
salt '*' file.check_managed /etc/httpd/conf.d/httpd.conf salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root, root, '755' jinja True None None base
salt.modules.file.check_managed_changes(name, source, source_hash, source_hash_name, user, group, mode, attrs, template, context, defaults, saltenv, contents=None, skip_verify=False, keep_mode=False, seuser=None, serole=None, setype=None, serange=None, verify_ssl=True, **kwargs) Return a dictionary of what changes need to be made for a file
Changed in version 3001: selinux attributes added
salt '*' file.check_managed_changes /etc/httpd/conf.d/httpd.conf salt://http/httpd.conf '{hash_type: 'md5', 'hsum': <md5sum>}' root, root, '755' jinja True None None base
salt.modules.file.check_perms(name, ret, user, group, mode, attrs=None, follow_symlinks=False, seuser=None, serole=None, setype=None, serange=None) Changed in version 3001: Added selinux options
Check the permissions on files, modify attributes and chown if needed. File attributes are only verified if lsattr(1) is installed.
salt '*' file.check_perms /etc/sudoers '{}' root root 400 ai
Changed in version 2014.1.3: follow_symlinks option added
salt.modules.file.chgrp(path, group) Change the group of a file
path   path to the file or directory
group  group owner
salt '*' file.chgrp /etc/passwd root
salt.modules.file.chown(path, user, group) Chown a file, pass the file the desired user and group
user   user owner