neulab/tldr huggingface dataset:
salt.modules.aptpkg.upgrade(refresh=True, dist_upgrade=False, **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 apt-get/dpkg 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).
Upgrades all packages via apt-get upgrade or apt-get dist-upgrade if  dist_upgrade is True.
Returns a dictionary containing the changes:
{'<package>':  {'old': '<old-version>', 'new': '<new-version>'}}
dist_upgrade Whether to perform the upgrade using dist-upgrade vs upgrade.  Default is to use upgrade.
refresh True If True, the apt cache will be refreshed first. By default, this is True and a refresh is performed.
download_only (or downloadonly) Only download the packages, don't unpack or install them. Use downloadonly to be in line with yum and zypper module.
salt.modules.aptpkg.upgrade_available(name, **kwargs) Check whether or not an upgrade is available for a given package
salt.modules.aptpkg.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.aptpkg.version_cmp(pkg1, pkg2, ignore_epoch=False, **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.
ignore_epoch False Set to True to ignore the epoch when comparing versions
New in version 2015.8.10,2016.3.2.
salt '*' pkg.version_cmp '0.2.4-0ubuntu1' '0.2.4.1-0ubuntu1'
salt.modules.archive A module to wrap (non-Windows) archive calls
salt.modules.archive.cmd_unzip(zip_file, dest, excludes=None, options=None, template=None, runas=None, trim_output=False, password=None) New in version 2015.5.0: In versions 2014.7.x and earlier, this function was known as archive.unzip.
Uses the unzip command to unpack zip files. This command is part of the Info-ZIP suite of tools, and is typically packaged as simply unzip.
zip_file Path of zip file to be unpacked
dest   The destination directory into which the file should be unpacked
excludes None Comma-separated list of files not to unpack. Can also be passed in a Python list.
template None Can be set to 'jinja' or another supported template engine to render the command arguments before execution:
salt '*' archive.cmd_unzip template=jinja /tmp/zipfile.zip '/tmp/{{grains.id}}' excludes=file_1,file_2
options Optional when using zip archives, ignored when usign other archives files. This is mostly used to overwrite existing files with o.  This options are only used when unzip binary is used.
New in version 2016.3.1.
runas  None Unpack the zip file as the specified user. Defaults to the user under which the minion is running.
trim_output False The number of files we should output on success before the rest are trimmed, if this is set to True then it will default to 100
password Password to use with password protected zip files
NOTE: This is not considered secure. It is recommended to instead use archive.unzip for password-protected ZIP files. If a password is used here, then the unzip command run to extract the ZIP file will not show up in the minion log like most shell commands Salt runs do. However, the password will still be present in the events logged to the minion log at the debug log level. If the minion is logging at debug (or more verbose), then be advised that the password will appear in the log.
salt '*' archive.cmd_unzip /tmp/zipfile.zip /home/strongbad/ excludes=file_1,file_2
salt.modules.archive.cmd_zip(zip_file, sources, template=None, cwd=None, runas=None) New in version 2015.5.0: In versions 2014.7.x and earlier, this function was known as archive.zip.
Uses the zip command to create zip files. This command is part of the Info-ZIP suite of tools, and is typically packaged as simply zip.
zip_file Path of zip file to be created
sources Comma-separated list of sources to include in the zip file. Sources can also be passed in a Python list.
Changed in version 2017.7.0: Globbing is now supported for this argument
salt '*' archive.cmd_zip template=jinja /tmp/zipfile.zip /tmp/sourcefile1,/tmp/{{grains.id}}.txt
cwd    None Use this argument along with relative paths in sources to create zip files which do not contain the leading directories. If not specified, the zip file will be created as if the cwd was /, and creating a zip file of /foo/bar/baz.txt will contain the parent directories foo and bar. To create a zip file containing just baz.txt, the following command would be used:
salt '*' archive.cmd_zip /tmp/baz.zip baz.txt cwd=/foo/bar
New in version 2014.7.1.
runas  None Create the zip file as the specified user. Defaults to the user under which the minion is running.
salt '*' archive.cmd_zip /tmp/zipfile.zip /tmp/sourcefile1,/tmp/sourcefile2 # Globbing for sources (2017.7.0 and later) salt '*' archive.cmd_zip /tmp/zipfile.zip '/tmp/sourcefile*'
salt.modules.archive.gunzip(gzipfile, template=None, runas=None, options=None) Uses the gunzip command to unpack gzip files
salt '*' archive.gunzip template=jinja /tmp/{{grains.id}}.txt.gz
runas  None The user with which to run the gzip command line
options None Pass any additional arguments to gzip
# Create /tmp/sourcefile.txt salt '*' archive.gunzip /tmp/sourcefile.txt.gz salt '*' archive.gunzip /tmp/sourcefile.txt options='--verbose'
salt.modules.archive.gzip(sourcefile, template=None, runas=None, options=None) Uses the gzip command to create gzip files
salt '*' archive.gzip template=jinja /tmp/{{grains.id}}.txt
# Create /tmp/sourcefile.txt.gz salt '*' archive.gzip /tmp/sourcefile.txt salt '*' archive.gzip /tmp/sourcefile.txt options='-9 --verbose'
salt.modules.archive.is_encrypted(name, clean=False, saltenv='base', source_hash=None) New in version 2016.11.0.
Returns True if the zip archive is password-protected, False if not. If the specified file is not a ZIP archive, an error will be raised.
name   The path / URL of the archive to check.
clean  False Set this value to True to delete the path referred to by name once the contents have been listed. This option should be used with care.
NOTE: If there is an error listing the archive's contents, the cached file will not be removed, to allow for troubleshooting.
saltenv base Specifies the fileserver environment from which to retrieve archive. This is only applicable when archive is a file from the salt:// fileserver.
source_hash If name is an http(s)/ftp URL and the file exists in the minion's file cache, this option can be passed to keep the minion from re-downloading the archive if the cached copy matches the specified hash.
salt '*' archive.is_encrypted /path/to/myfile.zip salt '*' archive.is_encrypted salt://foo.zip salt '*' archive.is_encrypted salt://foo.zip saltenv=dev salt '*' archive.is_encrypted https://domain.tld/myfile.zip clean=True salt '*' archive.is_encrypted https://domain.tld/myfile.zip source_hash=f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 salt '*' archive.is_encrypted ftp://10.1.2.3/foo.zip
salt.modules.archive.list_(name, archive_format=None, options=None, strip_components=None, clean=False, verbose=False, saltenv='base', source_hash=None) New in version 2016.11.0.
Changed in version 2016.11.2: The rarfile Python module is now supported for listing the contents of rar archives. This is necessary on minions with older releases of the rar CLI tool, which do not support listing the contents in a parsable format.
List the files and directories in an tar, zip, or rar archive.
NOTE: This function will only provide results for XZ-compressed archives if the xz CLI command is available, as Python does not at this time natively support XZ compression in its tarfile module. Keep in mind however that most Linux distros ship with xz already installed.
To check if a given minion has xz, the following Salt command can be run:
salt minion_id cmd.which xz
If None is returned, then xz is not present and must be installed.  It is widely available and should be packaged as either xz or xz-utils.
name   Path/URL of archive
archive_format Specify the format of the archive (tar, zip, or rar). If this argument is omitted, the archive format will be guessed based on the value of the name parameter.
options For tar archives only. This function will, by default, try to use the tarfile module from the Python standard library to get a list of files/directories. If this method fails, then it will fall back to using the shell to decompress the archive to stdout and pipe the results to tar -tf - to produce a list of filenames. XZ-compressed archives are already supported automatically, but in the event that the tar archive uses a different sort of compression not supported natively by tarfile, this option can be used to specify a command that will decompress the archive to stdout. For example:
salt minion_id archive.list /path/to/foo.tar.gz options='gzip --decompress --stdout'
NOTE: It is not necessary to manually specify options for gzip'ed archives, as gzip compression is natively supported by tarfile.
strip_components This argument specifies a number of top-level directories to strip from the results. This is similar to the paths that would be extracted if --strip-components (or --strip) were used when extracting tar archives.
verbose False If False, this function will return a list of files/dirs in the archive. If True, it will return a dictionary categorizing the paths into separate keys containing the directory names, file names, and also directories/files present in the top level of the archive.
Changed in version 2016.11.2: This option now includes symlinks in their own list. Before, they were included with files.
salt '*' archive.list /path/to/myfile.tar.gz salt '*' archive.list /path/to/myfile.tar.gz strip_components=1 salt '*' archive.list salt://foo.tar.gz salt '*' archive.list https://domain.tld/myfile.zip salt '*' archive.list https://domain.tld/myfile.zip source_hash=f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 salt '*' archive.list ftp://10.1.2.3/foo.rar
salt.modules.archive.rar(rarfile, sources, template=None, cwd=None, runas=None) Uses rar for Linux to create rar files
rarfile Path of rar file to be created
sources Comma-separated list of sources to include in the rar file. Sources can also be passed in a Python list.
cwd    None Run the rar command from the specified directory. Use this argument along with relative file paths to create rar files which do not contain the leading directories. If not specified, this will default to the home directory of the user under which the salt minion process is running.
salt '*' archive.rar template=jinja /tmp/rarfile.rar '/tmp/sourcefile1,/tmp/{{grains.id}}.txt'
salt '*' archive.rar /tmp/rarfile.rar /tmp/sourcefile1,/tmp/sourcefile2 # Globbing for sources (2017.7.0 and later) salt '*' archive.rar /tmp/rarfile.rar '/tmp/sourcefile*'
salt.modules.archive.tar(options, tarfile, sources=None, dest=None, cwd=None, template=None, runas=None)
NOTE: This function has changed for version 0.17.0. In prior versions, the cwd and template arguments must be specified, with the source directories/files coming as a space-separated list at the end of the command. Beginning with 0.17.0, sources must be a comma-separated list, and the cwd and template arguments are optional.
Uses the tar command to pack, unpack, etc. tar files
options Options to pass to the tar command
Changed in version 2015.8.0: The mandatory - prefixing has been removed.  An options string beginning with a --long-option, would have uncharacteristically needed its first - removed under the former scheme.
Also, tar will parse its options differently if short options are used with or without a preceding -, so it is better to not confuse the user into thinking they're using the non-- format, when really they are using the with-- format.
tarfile The filename of the tar archive to pack/unpack
sources Comma delimited list of files to pack into the tarfile. Can also be passed as a Python list.
dest   The destination directory into which to unpack the tarfile
cwd    None The directory in which the tar command should be executed. If not specified, will default to the home directory of the user under which the salt minion process is running.
salt '*' archive.tar cjvf /tmp/salt.tar.bz2 {{grains.saltpath}} template=jinja
# Create a tarfile salt '*' archive.tar cjvf /tmp/tarfile.tar.bz2 /tmp/file_1,/tmp/file_2 # Create a tarfile using globbing (2017.7.0 and later) salt '*' archive.tar cjvf /tmp/tarfile.tar.bz2 '/tmp/file_*' # Unpack a tarfile salt '*' archive.tar xf foo.tar dest=/target/directory
salt.modules.archive.unrar(rarfile, dest, excludes=None, template=None, runas=None, trim_output=False) Uses rar for Linux to unpack rar files
rarfile Name of rar file to be unpacked
dest   The destination directory into which to unpack the rar file
salt '*' archive.unrar template=jinja /tmp/rarfile.rar /tmp/{{grains.id}}/ excludes=file_1,file_2
salt '*' archive.unrar /tmp/rarfile.rar /home/strongbad/ excludes=file_1,file_2
salt.modules.archive.unzip(zip_file, dest, excludes=None, options=None, template=None, runas=None, trim_output=False, password=None, extract_perms=True) Uses the zipfile Python module to unpack zip files
Changed in version 2015.5.0: This function was rewritten to use Python's native zip file support.  The old functionality has been preserved in the new function archive.cmd_unzip. For versions 2014.7.x and earlier, see the archive.cmd_zip documentation.
options This options are only used when unzip binary is used. In this function is ignored.
salt '*' archive.unzip template=jinja /tmp/zipfile.zip /tmp/{{grains.id}}/ excludes=file_1,file_2
salt '*' archive.unzip /tmp/zipfile.zip /home/strongbad/ excludes=file_1,file_2
NOTE: The password will be present in the events logged to the minion log file at the debug log level. If the minion is logging at debug (or more verbose), then be advised that the password will appear in the log.
extract_perms True The Python zipfile module does not extract file/directory attributes by default. When this argument is set to True, Salt will attempt to apply the file permission attributes to the extracted files/folders.
On Windows, only the read-only flag will be extracted as set within the zip file, other attributes (i.e. user/group permissions) are ignored.
Set this argument to False to disable this behavior.
salt '*' archive.unzip /tmp/zipfile.zip /home/strongbad/ password='BadPassword'
salt.modules.archive.zip_(zip_file, sources, template=None, cwd=None, runas=None, zip64=False) Uses the zipfile Python module to create zip files
Changed in version 2015.5.0: This function was rewritten to use Python's native zip file support.  The old functionality has been preserved in the new function archive.cmd_zip. For versions 2014.7.x and earlier, see the archive.cmd_zip documentation.
salt '*' archive.zip template=jinja /tmp/zipfile.zip /tmp/sourcefile1,/tmp/{{grains.id}}.txt
salt '*' archive.zip /tmp/baz.zip baz.txt cwd=/foo/bar
zip64  False Used to enable ZIP64 support, necessary to create archives larger than 4 GByte in size.  If true, will create ZIP file with the ZIPp64 extension when the zipfile is larger than 2 GB.  ZIP64 extension is disabled by default in the Python native zip support because the default zip and unzip commands on Unix (the InfoZIP utilities) don't support these extensions.
salt '*' archive.zip /tmp/zipfile.zip /tmp/sourcefile1,/tmp/sourcefile2 # Globbing for sources (2017.7.0 and later) salt '*' archive.zip /tmp/zipfile.zip '/tmp/sourcefile*'
salt.modules.arista_pyeapi Arista pyeapi New in version 2019.2.0.
Execution module to interface the connection with Arista switches, connecting to the remote network device using the pyeapi library. It is flexible enough to execute the commands both when running under an Arista Proxy Minion, as well as running under a Regular Minion by specifying the connection arguments, i.e., device_type, host, username, password etc.
codeauthor Mircea Ulinic <ping@mirceaulinic.net>
depends pyeapi
NOTE: To understand how to correctly enable the eAPI on your switch, please check https://eos.arista.com/arista-eapi-101/.
Dependencies The pyeapi Execution module requires the Python Client for eAPI (pyeapi) to be installed: pip install pyeapi.
Usage This module can equally be used via the pyeapi Proxy module or directly from an arbitrary (Proxy) Minion that is running on a machine having access to the network device API, and the pyeapi library is installed.
When running outside of the pyeapi Proxy (i.e., from another Proxy Minion type, or regular Minion), the pyeapi connection arguments can be either specified from the CLI when executing the command, or in a configuration block under the pyeapi key in the configuration opts (i.e., (Proxy) Minion configuration file), or Pillar. The module supports these simultaneously. These fields are the exact same supported by the pyeapi Proxy Module:
transport: https Specifies the type of connection transport to use. Valid values for the connection are socket, http_local, http, and  https.
host: localhost The IP address or DNS host name of the connection device.
username: admin The username to pass to the device to authenticate the eAPI connection.
password The password to pass to the device to authenticate the eAPI connection.
port   The TCP port of the endpoint for the eAPI connection. If this keyword is not specified, the default value is automatically determined by the transport type (80 for http, or 443 for https).
enablepwd The enable mode password if required by the destination node.
Example (when not running in a pyeapi Proxy Minion):
pyeapi: username: test password: test
In case the username and password are the same on any device you are targeting, the block above (besides other parameters specific to your environment you might need) should suffice to be able to execute commands from outside a pyeapi Proxy, e.g.:
salt '*' pyeapi.run_commands 'show version' 'show interfaces' salt '*' pyeapi.config 'ntp server 1.2.3.4'
NOTE: Remember that the above applies only when not running in a pyeapi Proxy Minion. If you want to use the pyeapi Proxy, please follow the documentation notes for a proper setup.
salt.modules.arista_pyeapi.call(method, *args, **kwargs) Invoke an arbitrary pyeapi method.
method The name of the pyeapi method to invoke.
args   A list of arguments to send to the method invoked.
kwargs Key-value dictionary to send to the method invoked.
transport: https Specifies the type of connection transport to use. Valid values for the connection are socket, http_local, http, and https.
NOTE: This argument does not need to be specified when running in a pyeapi Proxy Minion.
salt '*' pyeapi.call run_commands "['show version']"
salt.modules.arista_pyeapi.config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs) Configures the node with the specified commands.
This method is used to send configuration commands to the node. It will take either a string or a list and prepend the necessary commands to put the session into config mode.
Returns the diff after the configuration commands are loaded.
config_file The source file with the configuration commands to be sent to the device.
The file can also be a template that can be rendered using the template engine of choice.
This can be specified using the absolute path to the file, or using one of the following URL schemes:
• salt://, to fetch the file from the Salt fileserver.
• http:// or https://
• ftp://
• s3://
• swift://
commands The commands to send to the node in config mode.  If the commands argument is a string it will be cast to a list. The list of commands will also be prepended with the necessary commands to put the session in config mode.
NOTE: This argument is ignored when config_file is specified.
template_engine: jinja The template engine to use when rendering the source file. Default: jinja. To simply fetch the file without attempting to render, set this argument to None.
context Variables to add to the template context.
defaults Default values of the context dict.
salt '*' pyeapi.config commands="['ntp server 1.2.3.4', 'ntp server 5.6.7.8']" salt '*' pyeapi.config config_file=salt://config.txt salt '*' pyeapi.config config_file=https://bit.ly/2LGLcDy context="{'servers': ['1.2.3.4']}"
salt.modules.arista_pyeapi.get_config(config='running-config', params=None, as_string=False, **kwargs) Retrieves the config from the device.
This method will retrieve the config from the node as either a string or a list object.  The config to retrieve can be specified as either the startup-config or the running-config.
config: running-config Specifies to return either the nodes startup-config or running-config.  The default value is the running-config.
params A string of keywords to append to the command for retrieving the config.
as_string: False Flag that determines the response.  If True, then the configuration is returned as a raw string.  If False, then the configuration is returned as a list.  The default value is False.
salt '*' pyeapi.get_config salt '*' pyeapi.get_config params='section snmp-server' salt '*' pyeapi.get_config config='startup-config'
salt.modules.arista_pyeapi.get_connection(**kwargs) Return the connection object to the pyeapi Node.
WARNING: This function returns an unserializable object, hence it is not meant to be used on the CLI. This should mainly be used when invoked from other modules for the low level connection with the network device.
kwargs Key-value dictionary with the authentication details.
USAGE Example:
conn = __salt__['pyeapi.get_connection'](host='router1.example.com', username='example', password='example') show_ver = conn.run_commands(['show version', 'show interfaces'])
salt.modules.arista_pyeapi.run_commands(*commands, **kwargs) Sends the commands over the transport to the device.
This function sends the commands to the device using the nodes transport.  This is a lower layer function that shouldn't normally need to be used, preferring instead to use config() or enable().
salt '*' pyeapi.run_commands 'show version' salt '*' pyeapi.run_commands 'show version' encoding=text salt '*' pyeapi.run_commands 'show version' encoding=text host=cr1.thn.lon username=example password=weak
Output example:
veos1: |_ ---------- architecture: i386 bootupTimestamp: 1527541728.53 hardwareRevision: internalBuildId: 63d2e89a-220d-4b8a-a9b3-0524fa8f9c5f internalVersion: 4.18.1F-4591672.4181F isIntlVersion: False memFree: 501468 memTotal: 1893316 modelName: vEOS serialNumber: systemMacAddress: 52:54:00:3f:e6:d0 version: 4.18.1F
salt.modules.arista_pyeapi.section(regex, config='running-config', **kwargs) Return a section of the config.
regex  A valid regular expression used to select sections of configuration to return.
config: running-config The configuration to return. Valid values for config are running-config or startup-config. The default value is running-config.
salt '*'
salt.modules.artifactory Module for fetching artifacts from Artifactory
exception salt.modules.artifactory.ArtifactoryError(value)
salt.modules.artifactory.get_latest_release(artifactory_url, repository, group_id, artifact_id, packaging, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None, use_literal_group_id=False) Gets the latest release of the artifact
artifactory_url URL of artifactory instance
repository Release repository in artifactory to retrieve artifact from, for example: libs-releases
group_id Group Id of the artifact
artifact_id Artifact Id of the artifact
packaging Packaging type (jar,war,ear,etc)
target_dir Target directory to download artifact to (default: /tmp)
target_file Target file to download artifact to (by default it is target_dir/artifact_id-version.packaging)
classifier Artifact classifier name (ex: sources,javadoc,etc). Optional parameter.
username Artifactory username. Optional parameter.
password Artifactory password. Optional parameter.
salt.modules.artifactory.get_latest_snapshot(artifactory_url, repository, group_id, artifact_id, packaging, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None, use_literal_group_id=False) Gets latest snapshot of the given artifact
repository Snapshot repository in artifactory to retrieve artifact from, for example: libs-snapshots
target_file Target file to download artifact to (by default it is target_dir/artifact_id-snapshot_version.packaging)
salt.modules.artifactory.get_release(artifactory_url, repository, group_id, artifact_id, packaging, version, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None, use_literal_group_id=False) Gets the specified release of the artifact
version Version of the artifact
salt.modules.artifactory.get_snapshot(artifactory_url, repository, group_id, artifact_id, packaging, version, snapshot_version=None, target_dir='/tmp', target_file=None, classifier=None, username=None, password=None, use_literal_group_id=False) Gets snapshot of the desired version of the artifact
salt.modules.at Wrapper module for at(1)
Also, a 'tag' feature has been added to more easily tag jobs.
platform linux,openbsd,freebsd
salt.modules.at.at(*args, **kwargs) Add a job to the queue.
The 'timespec' follows the format documented in the at(1) manpage.
salt '*' at.at <timespec> <cmd> [tag=<tag>] [runas=<user>] salt '*' at.at 12:05am '/sbin/reboot' tag=reboot salt '*' at.at '3:05am +3 days' 'bin/myscript' tag=nightly runas=jim
salt.modules.at.atc(jobid) Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text.
salt '*' at.atc <jobid>
salt.modules.at.atq(tag=None) List all queued and running jobs or only those with an optional 'tag'.
salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number]
salt.modules.at.atrm(*args) Remove jobs from the queue.
salt '*' at.atrm <jobid> <jobid> .. <jobid> salt '*' at.atrm all salt '*' at.atrm all [tag]
salt.modules.at.jobcheck(**kwargs) Check the job from queue.  The kwargs dict include 'hour minute day month year tag runas' Other parameters will be ignored.
salt '*' at.jobcheck runas=jam day=13 salt '*' at.jobcheck day=13 month=12 year=13 tag=rose
salt.modules.at_solaris Wrapper for at(1) on Solaris-like systems
NOTE: we try to mirror the generic at module where possible
maintainer jorge schrauwen <sjorge@blackdot.be>
platform solaris,illumos,smartso
salt.modules.at_solaris.at(*args, **kwargs) Add a job to the queue.
salt.modules.at_solaris.atc(jobid) Print the at(1) script that will run for the passed job id. This is mostly for debugging so the output will just be text.
salt.modules.at_solaris.atq(tag=None) List all queued and running jobs or only those with an optional 'tag'.
salt.modules.at_solaris.atrm(*args) Remove jobs from the queue.
salt.modules.at_solaris.jobcheck(**kwargs) Check the job from queue.  The kwargs dict include 'hour minute day month year tag runas' Other parameters will be ignored.
salt.modules.augeas_cfg Manages configuration files via augeas
This module requires the augeas Python module.
WARNING: Minimal installations of Debian and Ubuntu have been seen to have packaging bugs with python-augeas, causing the augeas module to fail to import. If the minion has the augeas module installed, but the functions in this execution module fail to run due to being unavailable, first restart the salt-minion service. If the problem persists past that, the following command can be run from the master to determine what is causing the import to fail:
salt minion-id cmd.run 'python -c "from augeas import Augeas"'
For affected Debian/Ubuntu hosts, installing libpython2.7 has been known to resolve the issue.
salt.modules.augeas_cfg.execute(context=None, lens=None, commands=(), load_path=None) Execute Augeas commands
salt '*' augeas.execute /files/etc/redis/redis.conf \ commands='["set bind 0.0.0.0", "set maxmemory 1G"]'
context The Augeas context
lens   The Augeas lens to use
commands The Augeas commands to execute
load_path A colon-spearated list of directories that modules should be searched in. This is in addition to the standard load path and the directories in AUGEAS_LENS_LIB.
salt.modules.augeas_cfg.get(path, value='', load_path=None) Get a value for a specific augeas path
salt '*' augeas.get /files/etc/hosts/1/ ipaddr
path   The path to get the value of
value  The optional value to get
salt.modules.augeas_cfg.ls(path, load_path=None) List the direct children of a node
salt '*' augeas.ls /files/etc/passwd
path   The path to list
salt.modules.augeas_cfg.match(path, value='', load_path=None) Get matches for path expression
salt '*' augeas.match /files/etc/services/service-name ssh
path   The path to match
value  The value to match on
salt.modules.augeas_cfg.remove(path, load_path=None) Get matches for path expression
salt '*' augeas.remove \ /files/etc/sysctl.conf/net.ipv4.conf.all.log_martians
path   The path to remove
salt.modules.augeas_cfg.setvalue(*args) Set a value for a specific augeas path
salt '*' augeas.setvalue /files/etc/hosts/1/canonical localhost
This will set the first entry in /etc/hosts to localhost
salt '*' augeas.setvalue /files/etc/hosts/01/ipaddr 192.168.1.1 \ /files/etc/hosts/01/canonical test
Adds a new host to /etc/hosts the ip address 192.168.1.1 and hostname test
salt '*' augeas.setvalue prefix=/files/etc/sudoers/ \ "spec[user = '%wheel']/user" "%wheel" \ "spec[user = '%wheel']/host_group/host" 'ALL' \ "spec[user = '%wheel']/host_group/command[1]" 'ALL' \ "spec[user = '%wheel']/host_group/command[1]/tag" 'PASSWD' \ "spec[user = '%wheel']/host_group/command[2]" '/usr/bin/apt-get' \ "spec[user = '%wheel']/host_group/command[2]/tag" NOPASSWD
Ensures that the following line is present in /etc/sudoers:
%wheel ALL = PASSWD : ALL , NOPASSWD : /usr/bin/apt-get , /usr/bin/aptitude
salt.modules.augeas_cfg.tree(path, load_path=None) Returns recursively the complete tree of a node
salt '*' augeas.tree /files/etc/
path   The base of the recursive listing
salt.modules.aws_sqs Support for the Amazon Simple Queue Service.
salt.modules.aws_sqs.create_queue(name, region, opts=None, user=None) Creates a queue with the correct name.
name   Name of the SQS queue to create
region Region to create the SQS queue in
opts   None Any additional options to add to the command line
user   None Run hg as a user other than what the minion runs as
salt '*' aws_sqs.create_queue <sqs queue> <region>
salt.modules.aws_sqs.delete_message(queue, region, receipthandle, opts=None, user=None) Delete one or more messages from a queue in a region
queue  The name of the queue to delete messages from
region Region where SQS queues exists
receipthandle The ReceiptHandle of the message to delete. The ReceiptHandle is obtained in the return from receive_message
user   None Run as a user other than what the minion runs as
salt '*' aws_sqs.delete_message <sqs queue> <region> receipthandle='<sqs ReceiptHandle>'
salt.modules.aws_sqs.delete_queue(name, region, opts=None, user=None) Deletes a queue in the region.
name   Name of the SQS queue to deletes
region Name of the region to delete the queue from
salt '*' aws_sqs.delete_queue <sqs queue> <region>
salt.modules.aws_sqs.list_queues(region, opts=None, user=None) List the queues in the selected region.
region Region to list SQS queues for
salt '*' aws_sqs.list_queues <region>
salt.modules.aws_sqs.queue_exists(name, region, opts=None, user=None) Returns True or False on whether the queue exists in the region
name   Name of the SQS queue to search for
region Name of the region to search for the queue in
salt '*' aws_sqs.queue_exists <sqs queue> <region>
salt.modules.aws_sqs.receive_message(queue, region, num=1, opts=None, user=None) Receive one or more messages from a queue in a region
queue  The name of the queue to receive messages from
num    1 The max number of messages to receive
salt '*' aws_sqs.receive_message <sqs queue> <region> salt '*' aws_sqs.receive_message <sqs queue> <region> num=10
salt.modules.azurearm_compute Azure (ARM) Compute Execution Module
maintainer <devops@decisionlab.io>
• azure >= 2.0.0
• azure-common >= 1.1.8
• azure-mgmt >= 1.0.0
• azure-mgmt-compute >= 1.0.0
• azure-mgmt-network >= 1.7.1
• azure-mgmt-resource >= 1.1.0
• azure-mgmt-storage >= 1.0.0
• azure-mgmt-web >= 0.32.0
• azure-storage >= 0.34.3
platform linux
configuration This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function in order to work properly.
Required provider parameters:
cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud.
Possible values:
salt.modules.azurearm_compute.availability_set_create_or_update(name, resource_group, **kwargs) New in version 2019.2.0.
Create or update an availability set.
• name -- The availability set to create.
• resource_group -- The resource group name assigned to the availability set.
salt-call azurearm_compute.availability_set_create_or_update testset testgroup
salt.modules.azurearm_compute.availability_set_delete(name, resource_group, **kwargs) New in version 2019.2.0.
Delete an availability set.
• name -- The availability set to delete.
salt-call azurearm_compute.availability_set_delete testset testgroup
salt.modules.azurearm_compute.availability_set_get(name, resource_group, **kwargs) New in version 2019.2.0.
Get a dictionary representing an availability set's properties.
• name -- The availability set to get.
salt-call azurearm_compute.availability_set_get testset testgroup
salt.modules.azurearm_compute.availability_sets_list(resource_group, **kwargs) New in version 2019.2.0.
List all availability sets within a resource group.
Parameters resource_group -- The resource group name to list availability sets within.
salt-call azurearm_compute.availability_sets_list testgroup
salt.modules.azurearm_compute.availability_sets_list_available_sizes(name, resource_group, **kwargs) New in version 2019.2.0.
List all available virtual machine sizes that can be used to to create a new virtual machine in an existing availability set.
• name -- The availability set name to list available virtual machine sizes within.
• resource_group -- The resource group name to list available availability set sizes within.
salt-call azurearm_compute.availability_sets_list_available_sizes testset testgroup
salt.modules.azurearm_compute.virtual_machine_capture(name, destination_name, resource_group, prefix='capture-', overwrite=False, **kwargs) New in version 2019.2.0.
Captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create similar VMs.
• name -- The name of the virtual machine.
• destination_name -- The destination container name.
• resource_group -- The resource group name assigned to the virtual machine.
• prefix -- (Default: 'capture-') The captured virtual hard disk's name prefix.
• overwrite -- (Default: False) Overwrite the destination disk in case of conflict.
salt-call azurearm_compute.virtual_machine_capture testvm testcontainer testgroup
salt.modules.azurearm_compute.virtual_machine_convert_to_managed_disks(name, resource_group, **kwargs) New in version 2019.2.0.
Converts virtual machine disks from blob-based to managed disks. Virtual machine must be stop-deallocated before invoking this operation.
• name -- The name of the virtual machine to convert.
salt-call azurearm_compute.virtual_machine_convert_to_managed_disks testvm testgroup
salt.modules.azurearm_compute.virtual_machine_deallocate(name, resource_group, **kwargs) New in version 2019.2.0.
Power off a virtual machine and deallocate compute resources.
• name -- The name of the virtual machine to deallocate.
salt-call azurearm_compute.virtual_machine_deallocate testvm testgroup
salt.modules.azurearm_compute.virtual_machine_generalize(name, resource_group, **kwargs) New in version 2019.2.0.
Set the state of a virtual machine to 'generalized'.
salt-call azurearm_compute.virtual_machine_generalize testvm testgroup
salt.modules.azurearm_compute.virtual_machine_get(name, resource_group, **kwargs) New in version 2019.2.0.
Retrieves information about the model view or the instance view of a virtual machine.
salt-call azurearm_compute.virtual_machine_get testvm testgroup
salt.modules.azurearm_compute.virtual_machine_power_off(name, resource_group, **kwargs) New in version 2019.2.0.
Power off (stop) a virtual machine.
• name -- The name of the virtual machine to stop.
salt-call azurearm_compute.virtual_machine_power_off testvm testgroup
salt.modules.azurearm_compute.virtual_machine_redeploy(name, resource_group, **kwargs) New in version 2019.2.0.
Redeploy a virtual machine.
• name -- The name of the virtual machine to redeploy.
salt-call azurearm_compute.virtual_machine_redeploy testvm testgroup
salt.modules.azurearm_compute.virtual_machine_restart(name, resource_group, **kwargs) New in version 2019.2.0.
Restart a virtual machine.
• name -- The name of the virtual machine to restart.
salt-call azurearm_compute.virtual_machine_restart testvm testgroup
salt.modules.azurearm_compute.virtual_machine_start(name, resource_group, **kwargs) New in version 2019.2.0.
Power on (start) a virtual machine.
• name -- The name of the virtual machine to start.
salt-call azurearm_compute.virtual_machine_start testvm testgroup
salt.modules.azurearm_compute.virtual_machines_list(resource_group, **kwargs) New in version 2019.2.0.
List all virtual machines within a resource group.
Parameters resource_group -- The resource group name to list virtual machines within.
salt-call azurearm_compute.virtual_machines_list testgroup
salt.modules.azurearm_compute.virtual_machines_list_all(**kwargs) New in version 2019.2.0.
List all virtual machines within a subscription.
salt-call azurearm_compute.virtual_machines_list_all
salt.modules.azurearm_compute.virtual_machines_list_available_sizes(name, resource_group, **kwargs) New in version 2019.2.0.
Lists all available virtual machine sizes to which the specified virtual machine can be resized.
salt-call azurearm_compute.virtual_machines_list_available_sizes testvm testgroup
salt.modules.azurearm_dns Azure (ARM) DNS Execution Module
• azure-mgmt-dns >= 2.0.0rc1
Required provider parameters: if using username and password:
Optional provider parameters: cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud.
salt.modules.azurearm_dns.record_set_create_or_update(name, zone_name, resource_group, record_type, **kwargs) New in version 3000.
Creates or updates a record set within a DNS zone.
• name -- The name of the record set, relative to the name of the zone.
• zone_name -- The name of the DNS zone (without a terminating dot).
• resource_group -- The name of the resource group.
• record_type -- The type of DNS record in this record set. Record sets of type SOA can be updated but not created (they are created when the DNS zone is created). Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
salt-call azurearm_dns.record_set_create_or_update myhost myzone testgroup A arecords='[{ipv4_address: 10.0.0.1}]' ttl=300
salt.modules.azurearm_dns.record_set_delete(name, zone_name, resource_group, record_type, **kwargs) New in version 3000.
Deletes a record set from a DNS zone. This operation cannot be undone.
• record_type -- The type of DNS record in this record set. Record sets of type SOA cannot be deleted (they are deleted when the DNS zone is deleted).  Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
salt-call azurearm_dns.record_set_delete myhost myzone testgroup A
salt.modules.azurearm_dns.record_set_get(name, zone_name, resource_group, record_type, **kwargs) New in version 3000.
Get a dictionary representing a record set's properties.
• record_type -- The type of DNS record in this record set. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
salt-call azurearm_dns.record_set_get '@' myzone testgroup SOA
salt.modules.azurearm_dns.record_sets_list_by_dns_zone(zone_name, resource_group, top=None, recordsetnamesuffix=None, **kwargs) New in version 3000.
Lists all record sets in a DNS zone.
• top -- The maximum number of record sets to return. If not specified, returns up to 100 record sets.
• recordsetnamesuffix -- The suffix label of the record set name that has to be used to filter the record set enumerations.
salt-call azurearm_dns.record_sets_list_by_dns_zone myzone testgroup
salt.modules.azurearm_dns.record_sets_list_by_type(zone_name, resource_group, record_type, top=None, recordsetnamesuffix=None, **kwargs) New in version 3000.
Lists the record sets of a specified type in a DNS zone.
• record_type -- The type of record sets to enumerate. Possible values include: 'A', 'AAAA', 'CAA', 'CNAME', 'MX', 'NS', 'PTR', 'SOA', 'SRV', 'TXT'
salt-call azurearm_dns.record_sets_list_by_type myzone testgroup SOA
salt.modules.azurearm_dns.zone_create_or_update(name, resource_group, **kwargs) New in version 3000.
Creates or updates a DNS zone. Does not modify DNS records within the zone.
• name -- The name of the DNS zone to create (without a terminating dot).
salt-call azurearm_dns.zone_create_or_update myzone testgroup
salt.modules.azurearm_dns.zone_delete(name, resource_group, **kwargs) New in version 3000.
Delete a DNS zone within a resource group.
• name -- The name of the DNS zone to delete.
salt-call azurearm_dns.zone_delete myzone testgroup
salt.modules.azurearm_dns.zone_get(name, resource_group, **kwargs) New in version 3000.
Get a dictionary representing a DNS zone's properties, but not the record sets within the zone.
• name -- The DNS zone to get.
salt-call azurearm_dns.zone_get myzone testgroup
salt.modules.azurearm_dns.zones_list(top=None, **kwargs) New in version 3000.
Lists the DNS zones in all resource groups in a subscription.
Parameters top -- The maximum number of DNS zones to return. If not specified, eturns up to 100 zones.
salt-call azurearm_dns.zones_list
salt.modules.azurearm_dns.zones_list_by_resource_group(resource_group, top=None, **kwargs) New in version 3000.
Lists the DNS zones in a resource group.
• top -- The maximum number of DNS zones to return. If not specified, returns up to 100 zones.
salt-call azurearm_dns.zones_list_by_resource_group testgroup
salt.modules.azurearm_network Azure (ARM) Network Execution Module
salt.modules.azurearm_network.check_dns_name_availability(name, region, **kwargs) New in version 2019.2.0.
Check whether a domain name in the current zone is available for use.
• name -- The DNS name to query.
• region -- The region to query for the DNS name in question.
salt-call azurearm_network.check_dns_name_availability testdnsname westus
salt.modules.azurearm_network.check_ip_address_availability(ip_address, virtual_network, resource_group, **kwargs) New in version 2019.2.0.
Check that a private ip address is available within the specified virtual network.
• ip_address -- The ip_address to query.
• virtual_network -- The virtual network to query for the IP address in question.
• resource_group -- The resource group name assigned to the virtual network.
salt-call azurearm_network.check_ip_address_availability 10.0.0.4 testnet testgroup
salt.modules.azurearm_network.default_security_rule_get(name, security_group, resource_group, **kwargs) New in version 2019.2.0.
Get details about a default security rule within a security group.
• name -- The name of the security rule to query.
• security_group -- The network security group containing the security rule.
• resource_group -- The resource group name assigned to the network security group.
salt-call azurearm_network.default_security_rule_get DenyAllOutBound testnsg testgroup
salt.modules.azurearm_network.default_security_rules_list(security_group, resource_group, **kwargs) New in version 2019.2.0.
List default security rules within a security group.
• security_group -- The network security group to query.
salt-call azurearm_network.default_security_rules_list testnsg testgroup
salt.modules.azurearm_network.get_virtual_machine_scale_set_network_interface(name, scale_set, vm_index, resource_group, **kwargs) New in version 2019.2.0.
Get information about a specific network interface within a scale set.
• name -- The name of the network interface to query.
• scale_set -- The name of the scale set containing the interface.
• vm_index -- The virtual machine index.
• resource_group -- The resource group name assigned to the scale set.
salt-call azurearm_network.get_virtual_machine_scale_set_network_interface test-iface0 testset testvm testgroup
salt.modules.azurearm_network.list_virtual_machine_scale_set_network_interfaces(scale_set, resource_group, **kwargs) New in version 2019.2.0.
Get information about all network interfaces within a scale set.
• scale_set -- The name of the scale set to query.
salt-call azurearm_network.list_virtual_machine_scale_set_vm_network_interfaces testset testgroup
salt.modules.azurearm_network.list_virtual_machine_scale_set_vm_network_interfaces(scale_set, vm_index, resource_group, **kwargs) New in version 2019.2.0.
Get information about all network interfaces in a specific virtual machine within a scale set.
salt-call azurearm_network.list_virtual_machine_scale_set_vm_network_interfaces testset testvm testgroup
salt.modules.azurearm_network.load_balancer_create_or_update(name, resource_group, **kwargs) New in version 2019.2.0.
Create or update a load balancer within a specified resource group.
• name -- The name of the load balancer to create.
• resource_group -- The resource group name assigned to the load balancer.
salt-call azurearm_network.load_balancer_create_or_update testlb testgroup
salt.modules.azurearm_network.load_balancer_delete(name, resource_group, **kwargs) New in version 2019.2.0.
Delete a load balancer.
• name -- The name of the load balancer to delete.
salt-call azurearm_network.load_balancer_delete testlb testgroup
salt.modules.azurearm_network.load_balancer_get(name, resource_group, **kwargs) New in version 2019.2.0.
Get details about a specific load balancer.
• name -- The name of the load balancer to query.
salt-call azurearm_network.load_balancer_get testlb testgroup
salt.modules.azurearm_network.load_balancers_list(resource_group, **kwargs) New in version 2019.2.0.
List all load balancers within a resource group.
Parameters resource_group -- The resource group name to list load balancers within.
salt-call azurearm_network.load_balancers_list testgroup
salt.modules.azurearm_network.load_balancers_list_all(**kwargs) New in version 2019.2.0.
List all load balancers within a subscription.
salt-call azurearm_network.load_balancers_list_all
salt.modules.azurearm_network.network_interface_create_or_update(name, ip_configurations, subnet, virtual_network, resource_group, **kwargs) New in version 2019.2.0.
Create or update a network interface within a specified resource group.
• name -- The name of the network interface to create.
• ip_configurations -- A list of dictionaries representing valid NetworkInterfaceIPConfiguration objects. The 'name' key is required at minimum. At least one IP Configuration must be present.
• subnet -- The name of the subnet assigned to the network interface.
• virtual_network -- The name of the virtual network assigned to the subnet.
salt-call azurearm_network.network_interface_create_or_update test-iface0 [{'name': 'testipconfig1'}]                   testsubnet testnet testgroup
salt.modules.azurearm_network.network_interface_delete(name, resource_group, **kwargs) New in version 2019.2.0.
Delete a network interface.
• name -- The name of the network interface to delete.
• resource_group -- The resource group name assigned to the network interface.
salt-call azurearm_network.network_interface_delete test-iface0 testgroup
salt.modules.azurearm_network.network_interface_get(name, resource_group, **kwargs) New in version 2019.2.0.
Get details about a specific network interface.
salt-call azurearm_network.network_interface_get test-iface0 testgroup
salt.modules.azurearm_network.network_interface_get_effective_route_table(name, resource_group, **kwargs) New in version 2019.2.0.
Get all route tables for a specific network interface.
salt-call azurearm_network.network_interface_get_effective_route_table test-iface0 testgroup
salt.modules.azurearm_network.network_interface_list_effective_network_security_groups(name, resource_group, **kwargs) New in version 2019.2.0.
Get all network security groups applied to a specific network interface.