neulab/tldr huggingface dataset:
salt.modules.firewalld.remove_service(service, zone=None, permanent=True) Remove a service from zone. This option can be specified multiple times.  If zone is omitted, default zone will be used.
salt '*' firewalld.remove_service ssh
To remove a service from a specific zone
salt '*' firewalld.remove_service ssh dmz
salt.modules.firewalld.remove_service_port(service, port) Remove a port from the specified service.
salt '*' firewalld.remove_service_port zone 80
salt.modules.firewalld.remove_service_protocol(service, protocol) Remove a protocol from the specified service.
salt '*' firewalld.remove_service_protocol zone ssh
salt.modules.firewalld.remove_source(zone, source, permanent=True) Remove a source bound to a zone
salt '*' firewalld.remove_source zone 192.168.1.0/24
salt.modules.firewalld.set_default_zone(zone) Set default zone
salt '*' firewalld.set_default_zone damian
salt.modules.firewalld.version() Return version from firewall-cmd
salt '*' firewalld.version
salt.modules.freebsd_sysctl Module for viewing and modifying sysctl parameters
salt.modules.freebsd_sysctl.assign(name, value) Assign a single sysctl parameter for this minion
salt '*' sysctl.assign net.inet.icmp.icmplim 50
salt.modules.freebsd_sysctl.get(name) Return a single sysctl parameter for this minion
salt '*' sysctl.get hw.physmem
salt.modules.freebsd_sysctl.persist(name, value, config='/etc/sysctl.conf') Assign and persist a simple sysctl parameter for this minion
salt '*' sysctl.persist net.inet.icmp.icmplim 50 salt '*' sysctl.persist coretemp_load NO config=/boot/loader.conf
salt.modules.freebsd_sysctl.show(config_file=False) Return a list of sysctl parameters for this minion
config: Pull the data from the system configuration file instead of the live data.
salt '*' sysctl.show
salt.modules.freebsd_update Support for freebsd-update utility on FreeBSD.
maintainer George Mamalakis <mamalos@gmail.com>
platform FreeBSD
salt.modules.freebsd_update.fetch(**kwargs) New in version 2016.3.4.
freebsd-update fetch wrapper. Based on the currently installed world and the configuration options set, fetch all available binary updates.
kwargs: Parameters of freebsd-update command.
salt.modules.freebsd_update.ids(**kwargs) New in version 2016.3.4.
freebsd-update IDS wrapper function. Compares the system against a "known good" index of the installed release.
salt.modules.freebsd_update.install(**kwargs) New in version 2016.3.4.
freebsd-update install wrapper. Install the most recently fetched updates or upgrade.
salt.modules.freebsd_update.rollback(**kwargs) New in version 2016.3.4.
freebsd-update rollback wrapper. Uninstalls the most recently installed updates.
salt.modules.freebsd_update.update(**kwargs) New in version 2016.3.4.
Command that simplifies freebsd-update by running freebsd-update fetch first and then freebsd-update install.
salt.modules.freebsd_update.upgrade(**kwargs) New in version 2016.3.4.
Dummy function used only to print a message that upgrade is not available.  The reason is that upgrade needs manual intervention and reboot, so even if used with: yes | freebsd-upgrade -r VERSION
the additional freebsd-update install that needs to run after the reboot cannot be implemented easily.
salt.modules.freebsdjail The jail module for FreeBSD
salt.modules.freebsdjail.fstab(jail) Display contents of a fstab(5) file defined in specified jail's configuration. If no file is defined, return False.
salt '*' jail.fstab <jail name>
salt.modules.freebsdjail.get_enabled() Return which jails are set to be run
salt '*' jail.get_enabled
salt.modules.freebsdjail.is_enabled() See if jail service is actually enabled on boot
salt '*' jail.is_enabled <jail name>
salt.modules.freebsdjail.restart(jail='') Restart the specified jail or all, if none specified
salt '*' jail.restart [<jail name>]
salt.modules.freebsdjail.show_config(jail) Display specified jail's configuration
salt '*' jail.show_config <jail name>
salt.modules.freebsdjail.start(jail='') Start the specified jail or all, if none specified
salt '*' jail.start [<jail name>]
salt.modules.freebsdjail.status(jail) See if specified jail is currently running
salt '*' jail.status <jail name>
salt.modules.freebsdjail.stop(jail='') Stop the specified jail or all, if none specified
salt '*' jail.stop [<jail name>]
salt.modules.freebsdjail.sysctl() Dump all jail related kernel states (sysctl)
salt '*' jail.sysctl
salt.modules.freebsdkmod Module to manage FreeBSD kernel modules
salt.modules.freebsdkmod.available() Return a list of all available kernel modules
salt '*' kmod.available
salt.modules.freebsdkmod.check_available(mod) Check to see if the specified kernel module is available
salt '*' kmod.check_available vmm
salt.modules.freebsdkmod.is_loaded(mod) Check to see if the specified kernel module is loaded
salt '*' kmod.is_loaded vmm
salt.modules.freebsdkmod.load(mod, persist=False) Load the specified kernel module
mod    Name of the module to add
persist Write the module to sysrc kld_modules to make it load on system reboot
salt '*' kmod.load bhyve
salt.modules.freebsdkmod.lsmod() Return a dict containing information about currently loaded modules
salt '*' kmod.lsmod
salt.modules.freebsdkmod.mod_list(only_persist=False) Return a list of the loaded module names
salt '*' kmod.mod_list
salt.modules.freebsdkmod.remove(mod, persist=False, comment=True) Remove the specified kernel module
mod    Name of module to remove
persist Also remove module from /boot/loader.conf
comment If persist is set don't remove line from /boot/loader.conf but only comment it
salt '*' kmod.remove vmm
salt.modules.freebsdpkg Remote package support using pkg_add(1)
WARNING: This module has been completely rewritten. Up to and including version 0.17.0, it supported pkg_add(1), but checked for the existence of a pkgng local database and, if found,  would provide some of pkgng's functionality. The rewrite of this module has removed all pkgng support, and moved it to the pkgng execution module. For versions <= 0.17.0, the documentation here should not be considered accurate. If your Minion is running one of these versions, then the documentation for this module can be viewed using the sys.doc function:
salt bsdminion sys.doc pkg
This module acts as the default package provider for FreeBSD 9 and older. If you need to use pkgng on a FreeBSD 9 system, you will need to override the pkg provider by setting the providers parameter in your Minion config file, in order to use pkgng.
providers: pkg: pkgng
More information on pkgng support can be found in the documentation for the pkgng module.
This module will respect the PACKAGEROOT and PACKAGESITE environment variables, if set, but these values can also be overridden in several ways:
1. Salt configuration parameters. The configuration parameters freebsdpkg.PACKAGEROOT and freebsdpkg.PACKAGESITE are recognized. These config parameters are looked up using config.get and can thus be specified in the Master config file, Grains, Pillar, or in the Minion config file. Example:
freebsdpkg.PACKAGEROOT: ftp://ftp.freebsd.org/ freebsdpkg.PACKAGESITE: ftp://ftp.freebsd.org/pub/FreeBSD/ports/ia64/packages-9-stable/Latest/
2. CLI arguments. Both the packageroot (used interchangeably with fromrepo for API compatibility) and packagesite CLI arguments are recognized, and override their config counterparts from section 1 above.
salt -G 'os:FreeBSD' pkg.install zsh fromrepo=ftp://ftp2.freebsd.org/ salt -G 'os:FreeBSD' pkg.install zsh packageroot=ftp://ftp2.freebsd.org/ salt -G 'os:FreeBSD' pkg.install zsh packagesite=ftp://ftp2.freebsd.org/pub/FreeBSD/ports/ia64/packages-9-stable/Latest/
.. note::
These arguments can also be passed through in states:
.. code-block:: yaml
zsh: pkg.installed: - fromrepo: ftp://ftp2.freebsd.org/
salt.modules.freebsdpkg.available_version(*names, **kwargs) This function is an alias of latest_version. pkg_add(1) is not capable of querying for remote packages, so this function will always return results as if there is no package available for install or upgrade.
salt.modules.freebsdpkg.delete(name=None, pkgs=None, **kwargs) This function is an alias of remove. Remove packages using pkg_delete(1)
salt.modules.freebsdpkg.file_dict(*packages, **kwargs) List the files that belong to a package, grouped by package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended).
salt.modules.freebsdpkg.file_list(*packages, **kwargs) List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's package database (not generally recommended).
salt.modules.freebsdpkg.install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, **kwargs) Install package(s) using pkg_add(1)
name   The name of the package to be installed.
fromrepo or packageroot Specify a package repository from which to install. Overrides the system default, as well as the PACKAGEROOT environment variable.
packagesite Specify the exact directory from which to install the remote package.  Overrides the PACKAGESITE environment variable, if present.
sources A list of packages to install. Must be passed as a list of dicts, with the keys being package names, and the values being the source URI or local path to the package.
salt '*' pkg.install sources='[{"foo": "salt://foo.deb"}, {"bar": "salt://bar.deb"}]'
salt.modules.freebsdpkg.latest_version(*names, **kwargs) pkg_add(1) is not capable of querying for remote packages, so this function will always return results as if there is no package available for install or upgrade.
salt.modules.freebsdpkg.list_pkgs(versions_as_list=False, with_origin=False, **kwargs) List the packages currently installed as a dict:
with_origin False Return a nested dictionary containing both the origin name and version for each installed package.
salt.modules.freebsdpkg.purge(name=None, pkgs=None, **kwargs) This function is an alias of remove. Remove packages using pkg_delete(1)
salt.modules.freebsdpkg.refresh_db(**kwargs) pkg_add(1) does not use a local database of available packages, so this function simply returns True. it exists merely for API compatibility.
salt.modules.freebsdpkg.remove(name=None, pkgs=None, **kwargs) Remove packages using pkg_delete(1)
salt.modules.freebsdpkg.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.
with_origin False Return a nested dictionary containing both the origin name and version for each specified package.
salt.modules.freebsdports Install software from the FreeBSD ports(7) system
This module allows you to install ports using BATCH=yes to bypass configuration prompts. It is recommended to use the ports state to install ports, but it is also possible to use this module exclusively from the command line.
salt minion-id ports.config security/nmap IPV6=off salt minion-id ports.install security/nmap
salt.modules.freebsdports.config(name, reset=False, **kwargs) Modify configuration options for a given port. Multiple options can be specified. To see the available options for a port, use ports.showconfig.
name   The port name, in category/name format
reset  False If True, runs a make rmconfig for the port, clearing its configuration before setting the desired options
salt '*' ports.config security/nmap IPV6=off
salt.modules.freebsdports.deinstall(name) De-install a port.
salt '*' ports.deinstall security/nmap
salt.modules.freebsdports.install(name, clean=True) Install a port from the ports tree. Installs using BATCH=yes for non-interactive building. To set config options for a given port, use ports.config.
clean  True If True, cleans after installation. Equivalent to running make install clean BATCH=yes.
NOTE: It may be helpful to run this function using the -t option to set a higher timeout, since compiling a port may cause the Salt command to exceed the default timeout.
salt -t 1200 '*' ports.install security/nmap
salt.modules.freebsdports.list_all() Lists all ports available.
salt '*' ports.list_all
WARNING: Takes a while to run, and returns a LOT of output
salt.modules.freebsdports.rmconfig(name) Clear the cached options for the specified port; run a make rmconfig
name   The name of the port to clear
salt '*' ports.rmconfig security/nmap
salt.modules.freebsdports.search(name) Search for matches in the ports tree. Globs are supported, and the category is optional
salt '*' ports.search 'security/*' salt '*' ports.search 'security/n*' salt '*' ports.search nmap
WARNING: Takes a while to run
salt.modules.freebsdports.showconfig(name, default=False, dict_return=False) Show the configuration options for a given port.
default False Show the default options for a port (not necessarily the same as the current configuration)
dict_return False Instead of returning the output of make showconfig, return the data in an dictionary
salt '*' ports.showconfig security/nmap salt '*' ports.showconfig security/nmap default=True
salt.modules.freebsdports.update(extract=False) Update the ports tree
extract False If True, runs a portsnap extract after fetching, should be used for first-time installation of the ports tree.
salt '*' ports.update
salt.modules.freebsdservice The service module for FreeBSD
salt.modules.freebsdservice.available(name, jail=None) Check that the given service is available.
Changed in version 2016.3.4.
jail: optional jid or jail name
salt.modules.freebsdservice.disable(name, **kwargs) Disable the named service to start at boot
Arguments the same as for enable()
jail (optional keyword argument) the jail's id or name
chroot (optional keyword argument) the jail's chroot, if the jail's /etc is not mounted read-write
salt.modules.freebsdservice.disabled(name, **kwargs) Return True if the named service is enabled, false otherwise
salt.modules.freebsdservice.enable(name, **kwargs) Enable the named service to start at boot
name   service name
config /etc/rc.conf Config file for managing service. If config value is empty string, then /etc/rc.conf.d/<service> used. See man rc.conf(5) for details.
Also service.config variable can be used to change default.
salt.modules.freebsdservice.enabled(name, **kwargs) Return True if the named service is enabled, false otherwise
Support for jail (representing jid or jail name) keyword argument in kwargs
salt.modules.freebsdservice.get_all(jail=None) Return a list of all available services
salt.modules.freebsdservice.get_disabled(jail=None) Return what services are available but not enabled to start at boot
salt.modules.freebsdservice.get_enabled(jail=None) Return what services are set to run on boot
salt.modules.freebsdservice.missing(name, jail=None) The inverse of service.available.  Returns True if the specified service is not available, otherwise returns False.
salt.modules.freebsdservice.reload_(name, jail=None) Restart the named service
salt.modules.freebsdservice.restart(name, jail=None) Restart the named service
salt.modules.freebsdservice.start(name, jail=None) Start the specified service
salt.modules.freebsdservice.status(name, sig=None, jail=None) Return the status for a service.  If the name contains globbing, a dict mapping service name to True/False values is returned.
salt.modules.freebsdservice.stop(name, jail=None) Stop the specified service
salt.modules.freezer maintainer Alberto Planas <aplanas@suse.com>
salt.modules.freezer.freeze(name=None, force=False, **kwargs) Save the list of package and repos in a freeze file.
As this module is build on top of the pkg module, the user can send extra attributes to the underlying pkg module via kwargs. This function will call pkg.list_pkgs and pkg.list_repos, and any additional arguments will be passed through to those functions.
name   Name of the frozen state. Optional.
force  If true, overwrite the state. Optional.
salt '*' freezer.freeze salt '*' freezer.freeze pre_install salt '*' freezer.freeze force=True root=/chroot
salt.modules.freezer.list_() Return the list of frozen states.
salt '*' freezer.list
salt.modules.freezer.restore(name=None, clean=False, **kwargs) Make sure that the system contains the packages and repos from a frozen state.
Read the list of packages and repositories from the freeze file, and compare it with the current list of packages and repos. If there is any difference, all the missing packages are repos will be installed, and all the extra packages and repos will be removed.
As this module is build on top of the pkg module, the user can send extra attributes to the underlying pkg module via kwargs. This function will call pkg.list_repos, pkg.mod_repo, pkg.list_pkgs, pkg.install, pkg.remove and pkg.del_repo, and any additional arguments will be passed through to those functions.
clean  If True remove the frozen information YAML from the cache
salt '*' freezer.restore salt '*' freezer.restore root=/chroot
salt.modules.freezer.status(name=None) Return True if there is already a frozen state.
A frozen state is merely a list of packages (including the version) in a specific time. This information can be used to compare with the current list of packages, and revert the installation of some extra packages that are in the system.
salt '*' freezer.status salt '*' freezer.status pre_install
salt.modules.gcp_addon A route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with virtual machine instances by tag, and the set of routes for a particular VM is called its routing table.  For each packet leaving a virtual machine, the system searches that machine's routing table for a single best matching route.
This module will create a route to send traffic destined to the Internet through your gateway instance.
codeauthor Pratik Bandarkar <pratik.bandarkar@gmail.com>
depends google-api-python-client
salt.modules.gcp_addon.route_create(credential_file=None, project_id=None, name=None, dest_range=None, next_hop_instance=None, instance_zone=None, tags=None, network=None, priority=None) Create a route to send traffic destined to the Internet through your gateway instance
credential_file string File location of application default credential. For more information, refer: https://developers.google.com/identity/protocols/application-default-credentials
project_id string Project ID where instance and network resides.
name   string name of the route to create
next_hop_instance string the name of an instance that should handle traffic matching this route.
instance_zone string zone where instance("next_hop_instance") resides
network string Specifies the network to which the route will be applied.
dest_range string The destination range of outgoing packets that the route will apply to.
tags   list (optional) Identifies the set of instances that this route will apply to.
priority int (optional) Specifies the priority of this route relative to other routes.  default=1000
salt 'salt-master.novalocal' gcp.route_create credential_file=/root/secret_key.json project_id=cp100-170315 name=derby-db-route1 next_hop_instance=instance-1 instance_zone=us-central1-a network=default dest_range=0.0.0.0/0 tags=['no-ip'] priority=700
In above example, the instances which are having tag "no-ip" will route the packet to instance "instance-1"(if packet is intended to other network)
salt.modules.gem Manage ruby gems.
salt.modules.gem.install(gems, ruby=None, gem_bin=None, runas=None, version=None, rdoc=False, ri=False, pre_releases=False, proxy=None, source=None) Installs one or several gems.
• gems -- string The gems to install
• gem_bin -- string : None Full path to gem binary to use.
• ruby -- string : None If RVM or rbenv are installed, the ruby version and gemset to use.  Ignored if gem_bin is specified.
• runas -- string : None The user to run gem as.
• version -- string : None Specify the version to install for the gem.  Doesn't play nice with multiple gems at once
• rdoc -- boolean : False Generate RDoc documentation for the gem(s).  For rubygems > 3 this is interpreted as the --no-document arg and the ri option will then be ignored
• ri -- boolean : False Generate RI documentation for the gem(s).  For rubygems > 3 this is interpreted as the --no-document arg and the rdoc option will then be ignored
• pre_releases -- boolean : False Include pre-releases in the available versions
• proxy -- string : None Use the specified HTTP proxy server for all outgoing traffic.  Format: http://hostname[:port]
source None Use the specified HTTP gem source server to download gem.  Format: http://hostname[:port]
salt '*' gem.install vagrant
salt '*' gem.install redphone gem_bin=/opt/sensu/embedded/bin/gem
salt.modules.gem.list_(prefix='', ruby=None, runas=None, gem_bin=None) List locally installed gems.
• prefix -- string : Only list gems when the name matches this prefix.
salt '*' gem.list
salt.modules.gem.list_upgrades(ruby=None, runas=None, gem_bin=None) New in version 2015.8.0.
Check if an upgrade is available for installed gems
gem_bin None Full path to gem binary to use.
ruby   None If RVM or rbenv are installed, the ruby version and gemset to use.  Ignored if gem_bin is specified.
runas  None The user to run gem as.
salt '*' gem.list_upgrades
salt.modules.gem.sources_add(source_uri, ruby=None, runas=None, gem_bin=None) Add a gem source.
• source_uri -- string The source URI to add.
salt '*' gem.sources_add http://rubygems.org/
salt.modules.gem.sources_list(ruby=None, runas=None, gem_bin=None) List the configured gem sources.
salt '*' gem.sources_list
salt.modules.gem.sources_remove(source_uri, ruby=None, runas=None, gem_bin=None) Remove a gem source.
• source_uri -- string The source URI to remove.
salt '*' gem.sources_remove http://rubygems.org/
salt.modules.gem.uninstall(gems, ruby=None, runas=None, gem_bin=None) Uninstall one or several gems.
• gems -- string The gems to uninstall.
salt '*' gem.uninstall vagrant
salt.modules.gem.update(gems, ruby=None, runas=None, gem_bin=None) Update one or several gems.
• gems -- string The gems to update.
salt '*' gem.update vagrant
salt.modules.gem.update_system(version='', ruby=None, runas=None, gem_bin=None) Update rubygems.
• version -- string : (newest) The version of rubygems to install.
salt '*' gem.update_system
salt.modules.gem.version(ruby=None, runas=None, gem_bin=None) Print out the version of gem
salt '*' gem.version
salt.modules.genesis Module for managing container and VM images
salt.modules.genesis.avail_platforms() Return which platforms are available
salt myminion genesis.avail_platforms
salt.modules.genesis.bootstrap(platform, root, img_format='dir', fs_format='ext2', fs_opts=None, arch=None, flavor=None, repo_url=None, static_qemu=None, img_size=None, mount_dir=None, pkg_cache=None, pkgs=None, exclude_pkgs=None, epel_url='http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm') Create an image for a specific platform.
Please note that this function MUST be run as root, as images that are created make files belonging to root.
platform Which platform to use to create the image. Currently supported platforms are rpm, deb and pacman.
root   Local path to create the root of the image filesystem.
img_format Which format to create the image in. By default, just copies files into a directory on the local filesystem (dir). Future support will exist for sparse.
fs_format When using a non-dir img_format, which filesystem to format the image to. By default, ext2.
fs_opts When using a non-dir img_format, a dict of opts may be specified.
arch   Architecture to install packages for, if supported by the underlying bootstrap tool. Currently only used for deb.
flavor Which flavor of operating system to install. This correlates to a specific directory on the distribution repositories. For instance, wheezy on Debian.
repo_url Mainly important for Debian-based repos. Base URL for the mirror to install from. (e.x.: http://ftp.debian.org/debian/)
static_qemu Local path to the static qemu binary required for this arch.  (e.x.: /usr/bin/qemu-amd64-static)
pkg_confs The location of the conf files to copy into the image, to point the installer to the right repos and configuration.
img_size If img_format is not dir, then the size of the image must be specified.
mount_dir If img_format is not dir, then the image must be mounted somewhere.  If the mount_dir is not specified, then it will be created at /opt/salt-genesis.<random_uuid>. This directory will be unmounted and removed when the process is finished.
pkg_cache This points to a directory containing a cache of package files to be copied to the image. It does not need to be specified.
pkgs   A list of packages to be installed on this image. For RedHat, this will include yum, centos-release and iputils by default.
exclude_pkgs A list of packages to be excluded. If you do not want to install the defaults, you need to include them in this list.
epel_url The URL to download the EPEL release package from.
salt myminion genesis.bootstrap pacman /root/arch salt myminion genesis.bootstrap rpm /root/redhat salt myminion genesis.bootstrap deb /root/wheezy arch=amd64             flavor=wheezy static_qemu=/usr/bin/qemu-x86_64-static
salt.modules.genesis.ldd_deps(filename, ret=None) Recurse through a set of dependencies reported by ldd, to find associated dependencies.
Please note that this does not necessarily resolve all (non-package) dependencies for a file; but it does help.
salt myminion genesis.ldd_deps bash salt myminion genesis.ldd_deps /bin/bash
salt.modules.genesis.mksls(fmt, src, dst=None) Convert an installation file/script to an SLS file. Currently supports kickstart, preseed, and autoyast.
salt <minion> genesis.mksls kickstart /path/to/kickstart.cfg salt <minion> genesis.mksls kickstart /path/to/kickstart.cfg /path/to/dest.sls
salt.modules.genesis.pack(name, root, path=None, pack_format='tar', compress='bzip2') Pack up a directory structure, into a specific format
salt myminion genesis.pack centos /root/centos salt myminion genesis.pack centos /root/centos pack_format='tar'
salt.modules.genesis.unpack(name, dest=None, path=None, pack_format='tar', compress='bz2') Unpack an image into a directory structure
salt myminion genesis.unpack centos /root/centos
salt.modules.gentoo_service Top level package command wrapper, used to translate the os detected by grains to the correct service manager
salt.modules.gentoo_service.available(name) Returns True if the specified service is available, otherwise returns False.
salt.modules.gentoo_service.disable(name, **kwargs) Disable the named service to start at boot
salt '*' service.disable <service name> <runlevels=single-runlevel> salt '*' service.disable <service name> <runlevels=[runlevel1,runlevel2]>
salt.modules.gentoo_service.disabled(name) Return True if the named service is enabled, false otherwise
salt '*' service.disabled <service name> <runlevels=[runlevel]>
salt.modules.gentoo_service.enable(name, **kwargs) Enable the named service to start at boot
salt '*' service.enable <service name> <runlevels=single-runlevel> salt '*' service.enable <service name> <runlevels=[runlevel1,runlevel2]>
salt.modules.gentoo_service.enabled(name, **kwargs) Return True if the named service is enabled, false otherwise
salt '*' service.enabled <service name> <runlevels=single-runlevel> salt '*' service.enabled <service name> <runlevels=[runlevel1,runlevel2]>
salt.modules.gentoo_service.get_all() Return all available boot services
salt.modules.gentoo_service.get_disabled() Return a set of services that are installed but disabled
salt.modules.gentoo_service.get_enabled() Return a list of service that are enabled on boot
salt.modules.gentoo_service.missing(name) The inverse of service.available.  Returns True if the specified service is not available, otherwise returns False.
salt.modules.gentoo_service.reload_(name) Reload the named service
salt.modules.gentoo_service.restart(name) Restart the named service
salt.modules.gentoo_service.start(name) Start the specified service
salt.modules.gentoo_service.status(name, sig=None) Return the status for a service.  If the name contains globbing, a dict mapping service name to True/False values is returned.
salt.modules.gentoo_service.stop(name) Stop the specified service
salt.modules.gentoo_service.zap(name) Resets service state
salt '*' service.zap <service name>
salt.modules.gentoolkitmod Support for Gentoolkit
salt.modules.gentoolkitmod.eclean_dist(destructive=False, package_names=False, size_limit=0, time_limit=0, fetch_restricted=False, exclude_file='/etc/eclean/distfiles.exclude') Clean obsolete portage sources
destructive Only keep minimum for reinstallation
package_names Protect all versions of installed packages. Only meaningful if used with destructive=True
size_limit <size> Don't delete distfiles bigger than <size>.  <size> is a size specification: "10M" is "ten megabytes", "200K" is "two hundreds kilobytes", etc. Units are: G, M, K and B.
time_limit <time> Don't delete distfiles files modified since <time> <time> is an amount of time: "1y" is "one year", "2w" is "two weeks", etc. Units are: y (years), m (months), w (weeks), d (days) and h (hours).
fetch_restricted Protect fetch-restricted files. Only meaningful if used with destructive=True
exclude_file Path to exclusion file. Default is /etc/eclean/distfiles.exclude This is the same default eclean-dist uses. Use None if this file exists and you want to ignore.
Returns a dict containing the cleaned, saved, and deprecated dists:
{'cleaned': {<dist file>: <size>}, 'deprecated': {<package>: <dist file>}, 'saved': {<package>: <dist file>}, 'total_cleaned': <size>}
salt '*' gentoolkit.eclean_dist destructive=True
salt.modules.gentoolkitmod.eclean_pkg(destructive=False, package_names=False, time_limit=0, exclude_file='/etc/eclean/packages.exclude') Clean obsolete binary packages
exclude_file Path to exclusion file. Default is /etc/eclean/packages.exclude This is the same default eclean-pkg uses. Use None if this file exists and you want to ignore.
Returns a dict containing the cleaned binary packages:
{'cleaned': {<dist file>: <size>}, 'total_cleaned': <size>}
salt '*' gentoolkit.eclean_pkg destructive=True
salt.modules.gentoolkitmod.glsa_check_list(glsa_list) List the status of Gentoo Linux Security Advisories
glsa_list can contain an arbitrary number of GLSA ids, filenames containing GLSAs or the special identifiers 'all' and 'affected'
Returns a dict containing glsa ids with a description, status, and CVEs:
{<glsa_id>: {'description': <glsa_description>, 'status': <glsa status>, 'CVEs': [<list of CVEs>]}}
salt '*' gentoolkit.glsa_check_list 'affected'
salt.modules.gentoolkitmod.revdep_rebuild(lib=None) Fix up broken reverse dependencies
lib    Search for reverse dependencies for a particular library rather than every library on the system. It can be a full path to a library or basic regular expression.
salt '*' gentoolkit.revdep_rebuild
salt.modules.git Support for the Git SCM
salt.modules.git.add(cwd, filename, opts='', git_opts='', user=None, password=None, ignore_retcode=False, output_encoding=None) Changed in version 2015.8.0: The --verbose command line argument is now implied
Interface to git-add(1)
cwd    The path to the git checkout
filename The location of the file/directory to add, relative to cwd
opts   Any additional options to add to the command line, in a single string
NOTE: On the Salt CLI, if the opts are preceded with a dash, it is necessary to precede them with opts= (as in the CLI examples below) to avoid causing errors with Salt's own argument parsing.
git_opts Any additional options to add to git command itself (not the add subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
NOTE: This is only supported in git 1.7.2 and newer.
user   User under which to run the git command. By default, the command is run by the user under which the minion is running.
password Windows only. Required when specifying user. This parameter will be ignored on non-Windows platforms.
ignore_retcode False If True, do not log an error to the minion log if the git command returns a nonzero exit status.
output_encoding Use this option to specify which encoding to use to decode the output from any git commands which are run. This should not be needed in most cases.
NOTE: This should only be needed if the files in the repository were created with filenames using an encoding other than UTF-8 to handle Unicode characters.
New in version 2018.3.1.
salt myminion git.add /path/to/repo foo/bar.py salt myminion git.add /path/to/repo foo/bar.py opts='--dry-run'
salt.modules.git.archive(cwd, output, rev='HEAD', prefix=None, git_opts='', user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) Changed in version 2015.8.0: Returns True if successful, raises an error if not.
Interface to git-archive(1), exports a tarball/zip file of the repository
cwd    The path to be archived
NOTE: git archive permits a partial archive to be created. Thus, this path does not need to be the root of the git repository. Only the files within the directory specified by cwd (and its subdirectories) will be in the resulting archive. For example, if there is a git checkout at /tmp/foo, then passing /tmp/foo/bar as the cwd will result in just the files underneath /tmp/foo/bar to be exported as an archive.
output The path of the archive to be created
overwrite False Unless set to True, Salt will over overwrite an existing archive at the path specified by the output argument.
rev    HEAD The revision from which to create the archive
format Manually specify the file format of the resulting archive. This argument can be omitted, and git archive will attempt to guess the archive type (and compression) from the filename. zip, tar, tar.gz, and tgz are extensions that are recognized automatically, and git can be configured to support other archive types with the addition of git configuration keys.
See the git-archive(1) manpage explanation of the --format argument (as well as the CONFIGURATION section of the manpage) for further information.
prefix Prepend <prefix> to every filename in the archive. If unspecified, the name of the directory at the top level of the repository will be used as the prefix (e.g. if cwd is set to /foo/bar/baz, the prefix will be baz, and the resulting archive will contain a top-level directory by that name).
NOTE: The default behavior if the --prefix option for git archive is not specified is to not prepend a prefix, so Salt's behavior differs slightly from git archive in this respect. Use prefix='' to create an archive with no prefix.
Changed in version 2015.8.0: The behavior of this argument has been changed slightly. As of this version, it is necessary to include the trailing slash when specifying a prefix, if the prefix is intended to create a top-level directory.
git_opts Any additional options to add to git command itself (not the archive subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
salt myminion git.archive /path/to/repo /path/to/archive.tar
salt.modules.git.branch(cwd, name=None, opts='', git_opts='', user=None, password=None, ignore_retcode=False, output_encoding=None) Interface to git-branch(1)
name   Name of the branch on which to operate. If not specified, the current branch will be assumed.
NOTE: To create a branch based on something other than HEAD, pass the name of the revision as opts. If the revision is in the format remotename/branch, then this will also set the remote tracking branch.
Additionally, on the Salt CLI, if the opts are preceded with a dash, it is necessary to precede them with opts= (as in the CLI examples below) to avoid causing errors with Salt's own argument parsing.
git_opts Any additional options to add to git command itself (not the branch subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
# Set remote tracking branch salt myminion git.branch /path/to/repo mybranch opts='--set-upstream-to origin/mybranch' # Create new branch salt myminion git.branch /path/to/repo mybranch upstream/somebranch # Delete branch salt myminion git.branch /path/to/repo mybranch opts='-d' # Rename branch (2015.8.0 and later) salt myminion git.branch /path/to/repo newbranch opts='-m oldbranch'
salt.modules.git.checkout(cwd, rev=None, force=False, opts='', git_opts='', user=None, password=None, ignore_retcode=False, output_encoding=None) Interface to git-checkout(1)
git_opts Any additional options to add to git command itself (not the checkout subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
rev    The remote branch or revision to checkout.
Changed in version 2015.8.0: Optional when using -b or -B in opts.
force  False Force a checkout even if there might be overwritten changes
# Checking out local local revisions salt myminion git.checkout /path/to/repo somebranch user=jeff salt myminion git.checkout /path/to/repo opts='testbranch -- conf/file1 file2' salt myminion git.checkout /path/to/repo rev=origin/mybranch opts='--track' # Checking out remote revision into new branch salt myminion git.checkout /path/to/repo upstream/master opts='-b newbranch' # Checking out current revision into new branch (2015.8.0 and later) salt myminion git.checkout /path/to/repo opts='-b newbranch'
salt.modules.git.clone(cwd, url=None, name=None, opts='', git_opts='', user=None, password=None, identity=None, https_user=None, https_pass=None, ignore_retcode=False, saltenv='base', output_encoding=None) Interface to git-clone(1)
cwd    Location of git clone
Changed in version 2015.8.0: If name is passed, then the clone will be made within this directory.
url    The URL of the repository to be cloned
Changed in version 2015.8.0: Argument renamed from repository to url
name   Optional alternate name for the top-level directory to be created by the clone
git_opts Any additional options to add to git command itself (not the clone subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
identity Path to a private key to use for ssh URLs
WARNING: Unless Salt is invoked from the minion using salt-call, the key(s) must be passphraseless. For greater security with passphraseless private keys, see the sshd(8) manpage for information on securing the keypair from the remote side in the authorized_keys file.
Changed in version 2015.8.7: Salt will no longer attempt to use passphrase-protected keys unless invoked from the minion using salt-call, to prevent blocking waiting for user input.
Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file
https_user Set HTTP Basic Auth username. Only accepted for HTTPS URLs.
New in version 20515.5.0.
https_pass Set HTTP Basic Auth password. Only accepted for HTTPS URLs.
saltenv The default salt environment to pull sls files from
salt myminion git.clone /path/to/repo_parent_dir git://github.com/saltstack/salt.git
salt.modules.git.commit(cwd, message, opts='', git_opts='', user=None, password=None, filename=None, ignore_retcode=False, output_encoding=None) Interface to git-commit(1)
message Commit message
opts   Any additional options to add to the command line, in a single string.  These opts will be added to the end of the git command being run.
The -m option should not be passed here, as the commit message will be defined by the message argument.
git_opts Any additional options to add to git command itself (not the commit subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
filename The location of the file/directory to commit, relative to cwd.  This argument is optional, and can be used to commit a file without first staging it.
NOTE: This argument only works on files which are already tracked by the git repository.
salt myminion git.commit /path/to/repo 'The commit message' salt myminion git.commit /path/to/repo 'The commit message' filename=foo/bar.py
salt.modules.git.config_get(key, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) Get the value of a key in the git configuration file
key    The name of the configuration key to get
Changed in version 2015.8.0: Argument renamed from setting_name to key
Changed in version 2015.8.0: Now optional if global is set to True
global False If True, query the global git configuration. Otherwise, only the local git configuration will be queried.
all    False If True, return a list of all values set for key. If the key does not exist, None will be returned.
salt myminion git.config_get user.name cwd=/path/to/repo salt myminion git.config_get user.email global=True salt myminion git.config_get core.gitproxy cwd=/path/to/repo all=True
salt.modules.git.config_get_regex(key, value_regex=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) This function is an alias of config_get_regexp. New in version 2015.8.0.
Get the value of a key or keys in the git configuration file using regexes for more flexible matching. The return data is a dictionary mapping keys to lists of values matching the value_regex. If no values match, an empty dictionary will be returned.
key    Regex on which key names will be matched
value_regex If specified, return all values matching this regex. The return data will be a dictionary mapping keys to lists of values matching the regex.
IMPORTANT: Only values matching the value_regex will be part of the return data. So, if key matches a multivar, then it is possible that not all of the values will be returned. To get all values set for a multivar, simply omit the value_regex argument.
# Matches any values for key 'foo.bar' salt myminion git.config_get_regexp /path/to/repo foo.bar # Matches any value starting with 'baz' set for key 'foo.bar' salt myminion git.config_get_regexp /path/to/repo foo.bar 'baz.*' # Matches any key starting with 'user.' salt myminion git.config_get_regexp '^user\.' global=True
salt.modules.git.config_get_regexp(key, value_regex=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) New in version 2015.8.0.
salt.modules.git.config_set(key, value=None, multivar=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) Changed in version 2015.8.0: Return the value(s) of the key being set
Set a key in the git configuration file
cwd    The path to the git checkout. Must be an absolute path, or the word global to indicate that a global key should be set.
Changed in version 2014.7.0: Made cwd argument optional if is_global=True
key    The name of the configuration key to set
value  The value to set for the specified key. Incompatible with the multivar argument.
Changed in version 2015.8.0: Argument renamed from setting_value to value
add    False Add a value to a key, creating/updating a multivar
multivar Set a multivar all at once. Values can be comma-separated or passed as a Python list. Incompatible with the value argument.
global False If True, set a global variable
salt myminion git.config_set user.email me@example.com cwd=/path/to/repo salt myminion git.config_set user.email foo@bar.com global=True
salt.modules.git.config_unset(key, value_regex=None, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs) New in version 2015.8.0.
Unset a key in the git configuration file
cwd    The path to the git checkout. Must be an absolute path, or the word global to indicate that a global key should be unset.
key    The name of the configuration key to unset
value_regex Regular expression that matches exactly one key, used to delete a single value from a multivar. Ignored if all is set to True.
all    False If True unset all values for a multivar. If False, and key is a multivar, an error will be raised.
global False If True, unset set a global variable. Otherwise, a local variable will be unset.
salt myminion git.config_unset /path/to/repo foo.bar salt myminion git.config_unset /path/to/repo foo.bar all=True
salt.modules.git.current_branch(cwd, user=None, password=None, ignore_retcode=False, output_encoding=None) Returns the current branch name of a local checkout. If HEAD is detached, return the SHA1 of the revision which is currently checked out.
salt myminion git.current_branch /path/to/repo
salt.modules.git.describe(cwd, rev='HEAD', user=None, password=None, ignore_retcode=False, output_encoding=None) Returns the git-describe(1) string (or the SHA1 hash if there are no tags) for the given revision.
rev    HEAD The revision to describe
salt myminion git.describe /path/to/repo salt myminion git.describe /path/to/repo develop
salt.modules.git.diff(cwd, item1=None, item2=None, opts='', git_opts='', user=None, password=None, no_index=False, cached=False, paths=None, output_encoding=None) New in version 2015.8.12,2016.3.3,2016.11.0.
Interface to git-diff(1)
item1 and item2 Revision(s) to pass to the git diff command. One or both of these arguments may be ignored if some of the options below are set to True. When cached is False, and no revisions are passed to this function, then the current working tree will be compared against the index (i.e. unstaged changes). When two revisions are passed, they will be compared to each other.
git_opts Any additional options to add to git command itself (not the diff subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
no_index False When it is necessary to diff two files in the same repo against each other, and not diff two different revisions, set this option to True. If this is left False in these instances, then a normal git diff will be performed against the index (i.e. unstaged changes), and files in the paths option will be used to narrow down the diff output.
NOTE: Requires Git 1.5.1 or newer. Additionally, when set to True, item1 and item2 will be ignored.
cached False If True, compare staged changes to item1 (if specified), otherwise compare them to the most recent commit.
NOTE: item2 is ignored if this option is is set to True.
paths  File paths to pass to the git diff command. Can be passed as a comma-separated list or a Python list.
# Perform diff against the index (staging area for next commit) salt myminion git.diff /path/to/repo # Compare staged changes to the most recent commit salt myminion git.diff /path/to/repo cached=True # Compare staged changes to a specific revision salt myminion git.diff /path/to/repo mybranch cached=True # Perform diff against the most recent commit (includes staged changes) salt myminion git.diff /path/to/repo HEAD # Diff two commits salt myminion git.diff /path/to/repo abcdef1 aabbccd # Diff two commits, only showing differences in the specified paths salt myminion git.diff /path/to/repo abcdef1 aabbccd paths=path/to/file1,path/to/file2 # Diff two files with one being outside the working tree salt myminion git.diff /path/to/repo no_index=True paths=path/to/file1,/absolute/path/to/file2
salt.modules.git.discard_local_changes(cwd, path='.', user=None, password=None, ignore_retcode=False, output_encoding=None) New in version 2019.2.0.
Runs a git checkout -- <path> from the directory specified by cwd.
path   path relative to cwd (defaults to .)
salt myminion git.discard_local_changes /path/to/repo salt myminion git.discard_local_changes /path/to/repo path=foo
salt.modules.git.fetch(cwd, remote=None, force=False, refspecs=None, opts='', git_opts='', user=None, password=None, identity=None, ignore_retcode=False, saltenv='base', output_encoding=None) Changed in version 2015.8.2: Return data is now a dictionary containing information on branches and tags that were added/updated
Interface to git-fetch(1)
remote Optional remote name to fetch. If not passed, then git will use its default behavior (as detailed in git-fetch(1)).
force  Force the fetch even when it is not a fast-forward.
refspecs Override the refspec(s) configured for the remote with this argument.  Multiple refspecs can be passed, comma-separated.
git_opts Any additional options to add to git command itself (not the fetch subcommand), in a single string. This is useful for passing -c to run git with temporary changes to the git configuration.
salt myminion git.fetch /path/to/repo upstream salt myminion git.fetch /path/to/repo identity=/root/.ssh/id_rsa
salt.modules.git.init(cwd, bare=False, template=None, separate_git_dir=None, shared=None, opts='', git_opts='', user=None, password=None, ignore_retcode=False, output_encoding=None) Interface to git-init(1)
cwd    The path to the directory to be initialized
bare   False If True, init a bare repository
template Set this argument to specify an alternate template directory