neulab/tldr huggingface dataset:
salt '*' pkg.restore /tmp/pkg chroot=/path/to/chroot
salt.modules.pkgng.search(name, jail=None, chroot=None, root=None, exact=False, glob=False, regex=False, pcre=False, comment=False, desc=False, full=False, depends=False, size=False, quiet=False, origin=False, prefix=False) Searches in remote package repositories
salt '*' pkg.search pattern
jail   Perform the search using the pkg.conf(5) from the specified jail
salt '*' pkg.search pattern jail=<jail name or id>
chroot Perform the search using the pkg.conf(5) from the specified chroot (ignored if jail is specified)
root   Perform the search using the pkg.conf(5) from the specified root (ignored if jail is specified)
salt '*' pkg.search pattern chroot=/path/to/chroot
exact  Treat pattern as exact pattern.
salt '*' pkg.search pattern exact=True
glob   Treat pattern as a shell glob pattern.
salt '*' pkg.search pattern glob=True
regex  Treat pattern as a regular expression.
salt '*' pkg.search pattern regex=True
pcre   Treat pattern as an extended regular expression.
salt '*' pkg.search pattern pcre=True
comment Search for pattern in the package comment one-line description.
salt '*' pkg.search pattern comment=True
desc   Search for pattern in the package description.
salt '*' pkg.search pattern desc=True
full   Displays full information about the matching packages.
salt '*' pkg.search pattern full=True
depends Displays the dependencies of pattern.
salt '*' pkg.search pattern depends=True
size   Displays the size of the package
salt '*' pkg.search pattern size=True
quiet  Be quiet. Prints only the requested information without displaying many hints.
salt '*' pkg.search pattern quiet=True
origin Displays pattern origin.
salt '*' pkg.search pattern origin=True
prefix Displays the installation prefix for each package matching pattern.
salt '*' pkg.search pattern prefix=True
salt.modules.pkgng.stats(local=False, remote=False, jail=None, chroot=None, root=None, bytes=False) Return pkgng stats.
salt '*' pkg.stats
local  Display stats only for the local package database.
salt '*' pkg.stats local=True
remote Display stats only for the remote package database(s).
salt '*' pkg.stats remote=True
bytes  Display disk space usage in bytes only.
salt '*' pkg.stats bytes=True
jail   Retrieve stats from the specified jail.
salt '*' pkg.stats jail=<jail name or id> salt '*' pkg.stats jail=<jail name or id> local=True salt '*' pkg.stats jail=<jail name or id> remote=True
chroot Retrieve stats from the specified chroot (ignored if jail is specified).
root   Retrieve stats from the specified root (ignored if jail is specified).
salt '*' pkg.stats chroot=/path/to/chroot salt '*' pkg.stats chroot=/path/to/chroot local=True salt '*' pkg.stats chroot=/path/to/chroot remote=True
salt.modules.pkgng.unhold(name=None, pkgs=None, **kwargs) Remove version locks
NOTE: This function is provided primarily for compatibility with some parts of states.pkg.  Consider using pkg.unlock instead.
name   The name of the package to be unheld
pkgs   A list of packages to unhold. Must be passed as a python list. The name parameter will be ignored if this option is passed.
salt '*' pkg.unhold <package name> salt '*' pkg.unhold pkgs='["foo", "bar"]'
salt.modules.pkgng.unlock(name, **kwargs) Unlock the named package against reinstallation, modification or deletion.
Returns True if the named package was successfully unlocked.
salt '*' pkg.unlock <package name>
jail   Unlock packages within the specified jail
salt '*' pkg.unlock <package name> jail=<jail name or id>
chroot Unlock packages within the specified chroot (ignored if jail is specified)
salt '*' pkg.unlock <package name> chroot=/path/to/chroot
root   Unlock packages within the specified root (ignored if jail is specified)
salt '*' pkg.unlock <package name> root=/path/to/chroot
salt.modules.pkgng.update(jail=None, chroot=None, root=None, force=False, **kwargs) This function is an alias of refresh_db. Refresh PACKAGESITE contents
salt.modules.pkgng.update_package_site(new_url) Updates remote package repo URL, PACKAGESITE var to be exact.
Must use http://, ftp://, or https:// protocol
salt '*' pkg.update_package_site http://127.0.0.1/
salt.modules.pkgng.updating(name, jail=None, chroot=None, root=None, filedate=None, filename=None) ' Displays UPDATING entries of software packages
salt '*' pkg.updating foo
jail   Perform the action in the specified jail
salt '*' pkg.updating foo jail=<jail name or id>
chroot Perform the action in the specified chroot (ignored if jail is specified)
root   Perform the action in the specified root (ignored if jail is specified)
salt '*' pkg.updating foo chroot=/path/to/chroot
filedate Only entries newer than date are shown. Use a YYYYMMDD date format.
salt '*' pkg.updating foo filedate=20130101
filename Defines an alternative location of the UPDATING file.
salt '*' pkg.updating foo filename=/tmp/UPDATING
salt.modules.pkgng.upgrade(*names, **kwargs) Upgrade named or all packages (run a pkg upgrade). If <package name> is omitted, the operation is executed on all packages.
salt '*' pkg.upgrade <package name>
salt '*' pkg.upgrade <package name> jail=<jail name or id>
salt '*' pkg.upgrade <package name> chroot=/path/to/chroot
Any of the below options can also be used with jail or chroot.
force  Force reinstalling/upgrading the whole set of packages.
salt '*' pkg.upgrade <package name> force=True
local  Do not update the repository catalogs with pkg-update(8). A value of True here is equivalent to using the -U flag with pkg upgrade.
salt '*' pkg.upgrade <package name> local=True
dryrun Dry-run mode: show what packages have updates available, but do not perform any upgrades. Repository catalogs will be updated as usual unless the local option is also given.
salt '*' pkg.upgrade <package name> dryrun=True
fromrepo In multi-repo mode, override the pkg.conf ordering and only attempt to upgrade packages from the named repository.
salt '*' pkg.upgrade <package name> fromrepo=repo
fetchonly Do not perform installation of packages, merely fetch packages that should be upgraded and detect possible conflicts.
salt '*' pkg.upgrade <package name> fetchonly=True
salt.modules.pkgng.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.pkgng.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.
salt '*' pkg.version_cmp '2.1.11' '2.1.12'
salt.modules.pkgng.which(path, jail=None, chroot=None, root=None, origin=False, quiet=False) Displays which package installed a specific file
salt '*' pkg.which <file name>
jail   Perform the check in the specified jail
salt '*' pkg.which <file name> jail=<jail name or id>
chroot Perform the check in the specified chroot (ignored if jail is specified)
root   Perform the check in the specified root (ignored if jail is specified)
salt '*' pkg.which <file name> chroot=/path/to/chroot
origin Shows the origin of the package instead of name-version.
salt '*' pkg.which <file name> origin=True
quiet  Quiet output.
salt '*' pkg.which <file name> quiet=True
salt.modules.pkgutil Pkgutil support for Solaris
salt.modules.pkgutil.available_version(*names, **kwargs) This function is an alias of latest_version. Return the latest version of the named package available for upgrade or installation. If more than one package name is specified, a dict of name/version pairs is returned.
salt '*' pkgutil.latest_version CSWpython salt '*' pkgutil.latest_version <package1> <package2> <package3> ...
salt.modules.pkgutil.install(name=None, refresh=False, version=None, pkgs=None, **kwargs) Install packages using the pkgutil tool.
salt '*' pkg.install <package_name> salt '*' pkg.install SMClgcc346
pkgs   A list of packages to install from OpenCSW. Must be passed as a python list.
salt '*' pkg.install pkgs='["foo", "bar"]' salt '*' pkg.install pkgs='["foo", {"bar": "1.2.3"}]'
salt.modules.pkgutil.latest_version(*names, **kwargs) Return the latest version of the named package available for upgrade or installation. If more than one package name is specified, a dict of name/version pairs is returned.
salt.modules.pkgutil.list_pkgs(versions_as_list=False, **kwargs) List the packages currently installed as a dict:
salt.modules.pkgutil.list_upgrades(refresh=True, **kwargs) List all available package upgrades on this system
salt '*' pkgutil.list_upgrades
salt.modules.pkgutil.purge(name=None, pkgs=None, **kwargs) Package purges are not supported, this function is identical to remove().
salt.modules.pkgutil.refresh_db() Updates the pkgutil repo database (pkgutil -U)
salt '*' pkgutil.refresh_db
salt.modules.pkgutil.remove(name=None, pkgs=None, **kwargs) Remove a package and all its dependencies which are not in use by other packages.
salt.modules.pkgutil.upgrade(refresh=True) Upgrade all of the packages to the latest available version.
Returns a dict containing the changes:
salt '*' pkgutil.upgrade
salt.modules.pkgutil.upgrade_available(name) Check if there is an upgrade available for a certain package
salt '*' pkgutil.upgrade_available CSWpython
salt.modules.pkgutil.version(*names, **kwargs) Returns a version if the package is installed, else returns an empty string
salt '*' pkgutil.version CSWpython
salt.modules.portage_config Configure portage(5)
salt.modules.portage_config.append_to_package_conf(conf, atom='', flags=None, string='', overwrite=False) Append a string or a list of flags for a given package or DEPEND atom to a given configuration file.
salt '*' portage_config.append_to_package_conf use string="app-admin/salt ldap -libvirt" salt '*' portage_config.append_to_package_conf use atom="> = app-admin/salt-0.14.1" flags="['ldap', '-libvirt']"
salt.modules.portage_config.append_use_flags(atom, uses=None, overwrite=False) Append a list of use flags for a given package or DEPEND atom
salt '*' portage_config.append_use_flags "app-admin/salt[ldap, -libvirt]" salt '*' portage_config.append_use_flags ">=app-admin/salt-0.14.1" "['ldap', '-libvirt']"
salt.modules.portage_config.enforce_nice_config() Enforce a nice tree structure for /etc/portage/package.* configuration files.
SEE ALSO:
salt.modules.ebuild.ex_mod_init() for information on automatically running this when pkg is used.
salt '*' portage_config.enforce_nice_config
salt.modules.portage_config.filter_flags(use, use_expand_hidden, usemasked, useforced) New in version 2015.8.0.
Filter function to remove hidden or otherwise not normally visible USE flags from a list.
@type use: list @param use: the USE flag list to be filtered. @type use_expand_hidden: list @param  use_expand_hidden: list of flags hidden.  @type usemasked: list @param usemasked: list of masked USE flags.  @type useforced: list @param useforced: the forced USE flags.  @rtype: list @return the filtered USE flags.
salt.modules.portage_config.get_all_cpv_use(cp) New in version 2015.8.0.
Uses portage to determine final USE flags and settings for an emerge.
@type cp: string @param cp: eg cat/pkg @rtype: lists @return  use, use_expand_hidden, usemask, useforce
salt.modules.portage_config.get_cleared_flags(cp) New in version 2015.8.0.
Uses portage for compare use flags which is used for installing package and use flags which now exist int /etc/portage/package.use/
@type cp: string @param cp: eg cat/pkg @rtype: tuple @rparam: tuple with two lists - list of used flags and list of flags which will be used
salt.modules.portage_config.get_flags_from_package_conf(conf, atom) Get flags for a given package or DEPEND atom.  Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
salt '*' portage_config.get_flags_from_package_conf license salt
salt.modules.portage_config.get_installed_use(cp, use='USE') New in version 2015.8.0.
Gets the installed USE flags from the VARDB.
@type: cp: string @param cp: cat/pkg @type use: string @param use: 1 of ["USE", "PKGUSE"] @rtype list @returns [] or the list of IUSE flags
salt.modules.portage_config.get_iuse(cp) New in version 2015.8.0.
Gets the current IUSE flags from the tree.
@type: cpv: string @param cpv: cat/pkg @rtype list @returns [] or the list of IUSE flags
salt.modules.portage_config.get_missing_flags(conf, atom, flags) Find out which of the given flags are currently not set.
salt '*' portage_config.get_missing_flags use salt "['ldap', '-libvirt', 'openssl']"
salt.modules.portage_config.has_flag(conf, atom, flag) Verify if the given package or DEPEND atom has the given flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
salt '*' portage_config.has_flag license salt Apache-2.0
salt.modules.portage_config.has_use(atom, use) Verify if the given package or DEPEND atom has the given use flag. Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
salt '*' portage_config.has_use salt libvirt
salt.modules.portage_config.is_changed_uses(cp) New in version 2015.8.0.
Uses portage for determine if the use flags of installed package is compatible with use flags in portage configs.
@type cp: string @param cp: eg cat/pkg
salt.modules.portage_config.is_present(conf, atom) Tell if a given package or DEPEND atom is present in the configuration files tree.  Warning: This only works if the configuration files tree is in the correct format (the one enforced by enforce_nice_config)
salt '*' portage_config.is_present unmask salt
salt.modules.postfix Support for Postfix
This module is currently little more than a config file viewer and editor. It is able to read the master.cf file (which is one style) and files in the style of main.cf (which is a different style, that is used in multiple postfix configuration files).
The design of this module is such that when files are edited, a minimum of changes are made to them. Each file should look as if it has been edited by hand; order, comments and whitespace are all preserved.
salt.modules.postfix.delete(queue_id) Delete message(s) from the mail queue
salt '*' postfix.delete 5C33CA0DEA
salt '*' postfix.delete ALL
salt.modules.postfix.hold(queue_id) Put message(s) on hold from the mail queue
salt '*' postfix.hold 5C33CA0DEA
salt '*' postfix.hold ALL
salt.modules.postfix.requeue(queue_id) Requeue message(s) in the mail queue
salt '*' postfix.requeue 5C33CA0DEA
salt '*' postfix.requeue ALL
salt.modules.postfix.set_main(key, value, path='/etc/postfix/main.cf') Set a single config value in the main.cf file. If the value does not already exist, it will be appended to the end.
salt <minion> postfix.set_main mailq_path /usr/bin/mailq
salt.modules.postfix.set_master(service, conn_type, private='y', unpriv='y', chroot='y', wakeup='n', maxproc='100', command='', write_conf=True, path='/etc/postfix/master.cf') Set a single config value in the master.cf file. If the value does not already exist, it will be appended to the end.
Because of shell parsing issues, '-' cannot be set as a value, as is normal in the master.cf file; either 'y', 'n' or a number should be used when calling this function from the command line. If the value used matches the default, it will internally be converted to a '-'. Calling this function from the Python API is not affected by this limitation
The settings and their default values, in order, are: service (required), conn_type (required), private (y), unpriv (y), chroot (y), wakeup (n), maxproc (100), command (required).
By default, this function will write out the changes to the master.cf file, and then returns the full contents of the file. By setting the write_conf option to False, it will skip writing the file.
salt <minion> postfix.set_master smtp inet n y n n 100 smtpd
salt.modules.postfix.show_main(path='/etc/postfix/main.cf') Return a dict of active config values. This does not include comments, spacing or order. Bear in mind that order is functionally important in the main.cf file, since keys can be referred to as variables. This means that the data returned from this function should not be used for direct modification of the main.cf file; other functions are available for that.
salt <minion> postfix.show_main salt <minion> postfix.show_main path=/path/to/main.cf
salt.modules.postfix.show_master(path='/etc/postfix/master.cf') Return a dict of active config values. This does not include comments, spacing or order.
The data returned from this function should not be used for direct modification of the main.cf file; other functions are available for that.
salt <minion> postfix.show_master salt <minion> postfix.show_master path=/path/to/master.cf
salt.modules.postfix.show_queue() Show contents of the mail queue
salt '*' postfix.show_queue
salt.modules.postfix.unhold(queue_id) Set held message(s) in the mail queue to unheld
salt '*' postfix.unhold 5C33CA0DEA
salt '*' postfix.unhold ALL
salt.modules.postgres Module to provide Postgres compatibility to salt.
configuration In order to connect to Postgres, certain configuration is required in /etc/salt/minion on the relevant minions. Some sample configs might look like:
postgres.host: 'localhost' postgres.port: '5432' postgres.user: 'postgres' -> db user postgres.pass: '' postgres.maintenance_db: 'postgres'
The default for the maintenance_db is 'postgres' and in most cases it can be left at the default setting.  This data can also be passed into pillar. Options passed into opts will overwrite options passed into pillar
note   This module uses MD5 hashing which may not be compliant with certain security audits.
note   When installing postgres from the official postgres repos, on certain linux distributions, either the psql or the initdb binary is not automatically placed on the path. Add a configuration to the location of the postgres bin's path to the relevant minion for this module:
postgres.bins_dir: '/usr/pgsql-9.5/bin/'
salt.modules.postgres.available_extensions(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) List available postgresql extensions
salt '*' postgres.available_extensions
salt.modules.postgres.create_extension(name, if_not_exists=None, schema=None, ext_version=None, from_version=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Install a postgresql extension
salt '*' postgres.create_extension 'adminpack'
salt.modules.postgres.create_metadata(name, ext_version=None, schema=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Get lifecycle information about an extension
salt '*' postgres.create_metadata adminpack
salt.modules.postgres.datadir_exists(name) New in version 2016.3.0.
Checks if postgres data directory has been initialized
salt '*' postgres.datadir_exists '/var/lib/pgsql/data'
name   Name of the directory to check
salt.modules.postgres.datadir_init(name, auth='password', user=None, password=None, encoding='UTF8', locale=None, waldir=None, checksums=False, runas=None) New in version 2016.3.0.
Initializes a postgres data directory
salt '*' postgres.datadir_init '/var/lib/pgsql/data'
name   The name of the directory to initialize
auth   The default authentication method for local connections
password The password to set for the postgres user
user   The database superuser name
encoding The default encoding for new databases
locale The default locale for new databases
waldir The transaction log (WAL) directory (default is to keep WAL inside the data directory)
checksums If True, the cluster will be created with data page checksums.
NOTE: Data page checksums are supported since PostgreSQL 9.3.
runas  The system user the operation should be performed on behalf of
salt.modules.postgres.db_alter(name, user=None, host=None, port=None, maintenance_db=None, password=None, tablespace=None, owner=None, owner_recurse=False, runas=None) Change tablespace or/and owner of database.
salt '*' postgres.db_alter dbname owner=otheruser
salt.modules.postgres.db_create(name, user=None, host=None, port=None, maintenance_db=None, password=None, tablespace=None, encoding=None, lc_collate=None, lc_ctype=None, owner=None, template=None, runas=None) Adds a databases to the Postgres server.
salt '*' postgres.db_create 'dbname'
salt '*' postgres.db_create 'dbname' template=template_postgis
salt.modules.postgres.db_exists(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Checks if a database exists on the Postgres server.
salt '*' postgres.db_exists 'dbname'
salt.modules.postgres.db_list(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Return dictionary with information about databases of a Postgres server.
salt '*' postgres.db_list
salt.modules.postgres.db_remove(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Removes a databases from the Postgres server.
salt '*' postgres.db_remove 'dbname'
salt.modules.postgres.drop_extension(name, if_exists=None, restrict=None, cascade=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Drop an installed postgresql extension
salt '*' postgres.drop_extension 'adminpack'
salt.modules.postgres.get_available_extension(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Get info about an available postgresql extension
salt '*' postgres.get_available_extension plpgsql
salt.modules.postgres.get_installed_extension(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Get info about an installed postgresql extension
salt '*' postgres.get_installed_extension plpgsql
salt.modules.postgres.group_create(groupname, user=None, host=None, port=None, maintenance_db=None, password=None, createdb=None, createroles=None, encrypted=None, login=None, inherit=None, superuser=None, replication=None, rolepassword=None, groups=None, runas=None) Creates a Postgres group. A group is postgres is similar to a user, but cannot login.
salt '*' postgres.group_create 'groupname' user='user' \ host='hostname' port='port' password='password' \ rolepassword='rolepassword'
salt.modules.postgres.group_remove(groupname, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Removes a group from the Postgres server.
salt '*' postgres.group_remove 'groupname'
salt.modules.postgres.group_update(groupname, user=None, host=None, port=None, maintenance_db=None, password=None, createdb=None, createroles=None, encrypted=None, inherit=None, login=None, superuser=None, replication=None, rolepassword=None, groups=None, runas=None) Updates a postgres group
salt '*' postgres.group_update 'username' user='user' \ host='hostname' port='port' password='password' \ rolepassword='rolepassword'
salt.modules.postgres.has_privileges(name, object_name, object_type, privileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Check if a role has the specified privileges on an object
salt '*' postgres.has_privileges user_name table_name table \ SELECT,INSERT maintenance_db=db_name
name   Name of the role whose privileges should be checked on object_type
object_name Name of the object on which the check is to be performed
object_type The object type, which can be one of the following:
• table
• sequence
• schema
• tablespace
• language
• database
• function
privileges Comma separated list of privileges to check, from the list below:
• INSERT
• CREATE
• TRUNCATE
• CONNECT
• TRIGGER
• SELECT
• USAGE
• TEMPORARY
• UPDATE
• EXECUTE
• REFERENCES
• DELETE
• ALL
grant_option If grant_option is set to True, the grant option check is performed
prepend Table and Sequence object types live under a schema so this should be provided if the object is not under the default public schema
maintenance_db The database to connect to
user   database username if different from config or default
password user password if any password for a specified user
host   Database host if different from config or default
port   Database port if different from config or default
runas  System user all operations should be performed on behalf of
salt.modules.postgres.installed_extensions(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) List installed postgresql extensions
salt '*' postgres.installed_extensions
salt.modules.postgres.is_available_extension(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Test if a specific extension is available
salt '*' postgres.is_available_extension
salt.modules.postgres.is_installed_extension(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Test if a specific extension is installed
salt '*' postgres.is_installed_extension
salt.modules.postgres.language_create(name, maintenance_db, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Installs a language into a database
salt '*' postgres.language_create plpgsql dbname
name   Language to install
maintenance_db The database to install the language in
salt.modules.postgres.language_exists(name, maintenance_db, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Checks if language exists in a database.
salt '*' postgres.language_exists plpgsql dbname
name   Language to check for
maintenance_db The database to check in
salt.modules.postgres.language_list(maintenance_db, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Return a list of languages in a database.
salt '*' postgres.language_list dbname
maintenance_db The database to check
salt.modules.postgres.language_remove(name, maintenance_db, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Removes a language from a database
salt '*' postgres.language_remove plpgsql dbname
name   Language to remove
salt.modules.postgres.owner_to(dbname, ownername, user=None, host=None, port=None, password=None, runas=None) Set the owner of all schemas, functions, tables, views and sequences to the given username.
salt '*' postgres.owner_to 'dbname' 'username'
salt.modules.postgres.privileges_grant(name, object_name, object_type, privileges=None, grant_option=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Grant privileges on a postgres object
salt '*' postgres.privileges_grant user_name table_name table \ SELECT,UPDATE maintenance_db=db_name
name   Name of the role to which privileges should be granted
object_name Name of the object on which the grant is to be performed
privileges Comma separated list of privileges to grant, from the list below:
grant_option If grant_option is set to True, the recipient of the privilege can in turn grant it to others
salt.modules.postgres.privileges_list(name, object_type, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Return a list of privileges for the specified object.
salt '*' postgres.privileges_list table_name table maintenance_db=db_name
name   Name of the object for which the permissions should be returned
salt.modules.postgres.privileges_revoke(name, object_name, object_type, privileges=None, prepend='public', maintenance_db=None, user=None, host=None, port=None, password=None, runas=None) New in version 2016.3.0.
Revoke privileges on a postgres object
salt '*' postgres.privileges_revoke user_name table_name table \ SELECT,UPDATE maintenance_db=db_name
name   Name of the role whose privileges should be revoked
object_name Name of the object on which the revoke is to be performed
privileges Comma separated list of privileges to revoke, from the list below:
salt.modules.postgres.psql_query(query, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None, write=False) Run an SQL-Query and return the results as a list. This command only supports SELECT statements.  This limitation can be worked around with a query like this:
WITH updated AS (UPDATE pg_authid SET rolconnlimit = 2000 WHERE rolname = 'rolename' RETURNING rolconnlimit) SELECT * FROM updated;
query  The query string.
user   Database username, if different from config or default.
host   Database host, if different from config or default.
port   Database port, if different from the config or default.
maintenance_db The database to run the query against.
password User password, if different from the config or default.
runas  User to run the command as.
write  Mark query as READ WRITE transaction.
salt '*' postgres.psql_query 'select * from pg_stat_activity'
salt.modules.postgres.role_get(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None, return_password=False) Return a dict with information about users of a Postgres server.
Set return_password to True to get password hash in the result.
salt '*' postgres.role_get postgres
salt.modules.postgres.schema_create(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None) Creates a Postgres schema.
salt '*' postgres.schema_create dbname name owner='owner' \ user='user' \ db_user='user' db_password='password' db_host='hostname' db_port='port'
salt.modules.postgres.schema_exists(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None) Checks if a schema exists on the Postgres server.
salt '*' postgres.schema_exists dbname schemaname
dbname Database name we query on
name   Schema name we look for
user   The system user the operation should be performed on behalf of
db_user database username if different from config or default
db_password user password if any password for a specified user
db_host Database host if different from config or default
db_port Database port if different from config or default
salt.modules.postgres.schema_get(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None) Return a dict with information about schemas in a database.
salt '*' postgres.schema_get dbname name
salt.modules.postgres.schema_list(dbname, user=None, db_user=None, db_password=None, db_host=None, db_port=None) Return a dict with information about schemas in a Postgres database.
salt '*' postgres.schema_list dbname
salt.modules.postgres.schema_remove(dbname, name, user=None, db_user=None, db_password=None, db_host=None, db_port=None) Removes a schema from the Postgres server.
salt '*' postgres.schema_remove dbname schemaname
dbname Database name we work on
schemaname The schema's name we'll remove
user   System user all operations should be performed on behalf of
salt.modules.postgres.tablespace_alter(name, user=None, host=None, port=None, maintenance_db=None, password=None, new_name=None, new_owner=None, set_option=None, reset_option=None, runas=None) Change tablespace name, owner, or options.
salt '*' postgres.tablespace_alter tsname new_owner=otheruser salt '*' postgres.tablespace_alter index_space new_name=fast_raid salt '*' postgres.tablespace_alter test set_option="{'seq_page_cost': '1.1'}" salt '*' postgres.tablespace_alter tsname reset_option=seq_page_cost
salt.modules.postgres.tablespace_create(name, location, options=None, owner=None, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Adds a tablespace to the Postgres server.
salt '*' postgres.tablespace_create tablespacename '/path/datadir'
salt.modules.postgres.tablespace_exists(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Checks if a tablespace exists on the Postgres server.
salt '*' postgres.tablespace_exists 'dbname'
salt.modules.postgres.tablespace_list(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Return dictionary with information about tablespaces of a Postgres server.
salt '*' postgres.tablespace_list
salt.modules.postgres.tablespace_remove(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Removes a tablespace from the Postgres server.
salt '*' postgres.tablespace_remove tsname
salt.modules.postgres.user_create(username, user=None, host=None, port=None, maintenance_db=None, password=None, createdb=None, createroles=None, inherit=None, login=None, connlimit=None, encrypted=None, superuser=None, replication=None, rolepassword=None, valid_until=None, groups=None, runas=None) Creates a Postgres user.
salt '*' postgres.user_create 'username' user='user' \ host='hostname' port='port' password='password' \ rolepassword='rolepassword' valid_until='valid_until'
salt.modules.postgres.user_exists(name, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Checks if a user exists on the Postgres server.
salt '*' postgres.user_exists 'username'
salt.modules.postgres.user_list(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None, return_password=False) Return a dict with information about users of a Postgres server.
salt '*' postgres.user_list
salt.modules.postgres.user_remove(username, user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Removes a user from the Postgres server.
salt '*' postgres.user_remove 'username'
salt.modules.postgres.user_update(username, user=None, host=None, port=None, maintenance_db=None, password=None, createdb=None, createroles=None, encrypted=None, superuser=None, inherit=None, login=None, connlimit=None, replication=None, rolepassword=None, valid_until=None, groups=None, runas=None) Updates a Postgres user.
salt '*' postgres.user_update 'username' user='user' \ host='hostname' port='port' password='password' \ rolepassword='rolepassword' valid_until='valid_until'
salt.modules.postgres.version(user=None, host=None, port=None, maintenance_db=None, password=None, runas=None) Return the version of a Postgres server.
salt '*' postgres.version
salt.modules.poudriere Support for poudriere
salt.modules.poudriere.bulk_build(jail, pkg_file, keep=False) Run bulk build on poudriere server.
Return number of pkg builds, failures, and errors, on error dump to CLI
salt -N buildbox_group poudriere.bulk_build 90amd64 /root/pkg_list
salt.modules.poudriere.create_jail(name, arch, version='9.0-RELEASE') Creates a new poudriere jail if one does not exist
NOTE creating a new jail will take some time the master is not hanging
salt '*' poudriere.create_jail 90amd64 amd64
salt.modules.poudriere.create_ports_tree() Not working need to run portfetch non interactive
salt.modules.poudriere.delete_jail(name) Deletes poudriere jail with name
salt '*' poudriere.delete_jail 90amd64
salt.modules.poudriere.info_jail(name) Show information on name poudriere jail
salt '*' poudriere.info_jail head-amd64
salt.modules.poudriere.is_jail(name) Return True if jail exists False if not
salt '*' poudriere.is_jail <jail name>
salt.modules.poudriere.list_jails() Return a list of current jails managed by poudriere
salt '*' poudriere.list_jails
salt.modules.poudriere.list_ports() Return a list of current port trees managed by poudriere
salt '*' poudriere.list_ports
salt.modules.poudriere.make_pkgng_aware(jname) Make jail jname pkgng aware
salt '*' poudriere.make_pkgng_aware <jail name>
salt.modules.poudriere.parse_config(config_file=None) Returns a dict of poudriere main configuration definitions
salt '*' poudriere.parse_config
salt.modules.poudriere.update_jail(name) Run freebsd-update on name poudriere jail
salt '*' poudriere.update_jail freebsd:10:x86:64
salt.modules.poudriere.update_ports_tree(ports_tree) Updates the ports tree, either the default or the ports_tree specified
salt '*' poudriere.update_ports_tree staging
salt.modules.poudriere.version() Return poudriere version
salt '*' poudriere.version
salt.modules.powerpath powerpath support.
Assumes RedHat
salt.modules.powerpath.add_license(key) Add a license
salt.modules.powerpath.has_powerpath()
salt.modules.powerpath.list_licenses() returns a list of applied powerpath license keys
salt.modules.powerpath.remove_license(key) Remove a license
salt.modules.proxy This module allows you to manage proxy settings
salt '*' network.get_http_proxy
salt.modules.proxy.get_ftp_proxy(network_service='Ethernet') Returns the current ftp proxy settings
network_service The network service to apply the changes to, this only necessary on macOS
salt '*' proxy.get_ftp_proxy Ethernet
salt.modules.proxy.get_http_proxy(network_service='Ethernet') Returns the current http proxy settings
salt '*' proxy.get_http_proxy Ethernet
salt.modules.proxy.get_https_proxy(network_service='Ethernet') Returns the current https proxy settings
salt '*' proxy.get_https_proxy Ethernet
salt.modules.proxy.get_proxy_bypass(network_service='Ethernet') Returns the current domains that can bypass the proxy
network_service The network service to get the bypass domains from, this is only necessary on macOS
salt '*' proxy.get_proxy_bypass
salt.modules.proxy.get_proxy_win() Gets all of the proxy settings in one call, only available on Windows
salt '*' proxy.get_proxy_win
salt.modules.proxy.set_ftp_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None) Sets the ftp proxy settings
server The proxy server to use
port   The port used by the proxy server
user   The username to use for the proxy server if required
password The password to use if required by the server
bypass_hosts The hosts that are allowed to by pass the proxy. Only used on Windows for other OS's use set_proxy_bypass to edit the bypass hosts.
salt '*' proxy.set_ftp_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_http_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None) Sets the http proxy settings. Note: On Windows this will override any other proxy settings you have, the preferred method of updating proxies on windows is using set_proxy.
salt '*' proxy.set_http_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_https_proxy(server, port, user=None, password=None, network_service='Ethernet', bypass_hosts=None) Sets the https proxy settings. Note: On Windows this will override any other proxy settings you have, the preferred method of updating proxies on windows is using set_proxy.
salt '*' proxy.set_https_proxy example.com 1080 user=proxy_user password=proxy_pass network_service=Ethernet
salt.modules.proxy.set_proxy_bypass(domains, network_service='Ethernet') Sets the domains that can bypass the proxy
domains An array of domains allowed to bypass the proxy
salt '*' proxy.set_proxy_bypass "['127.0.0.1', 'localhost']"
salt.modules.proxy.set_proxy_win(server, port, types=None, bypass_hosts=None) Sets the http proxy settings, only works with Windows.
types  The types of proxy connections should be setup with this server. Valid types are:
• http
• https
• ftp
bypass_hosts The hosts that are allowed to by pass the proxy.
salt '*' proxy.set_http_proxy example.com 1080 types="['http', 'https']"
salt.modules.ps A salt interface to psutil, a system and process library.  See http://code.google.com/p/psutil.
• psutil Python module, version 0.3.0 or later
• python-utmp package (optional)
salt.modules.ps.boot_time(time_format=None) Return the boot time in number of seconds since the epoch began.
time_format Optionally specify a strftime format string. Use time_format='%c' to get a nicely-formatted locale specific date and time (i.e. Fri May  2 19:08:32 2014).
New in version 2014.1.4.
salt '*' ps.boot_time
salt.modules.ps.cpu_percent(interval=0.1, per_cpu=False) Return the percent of time the CPU is busy.
interval the number of seconds to sample CPU usage over
per_cpu if True return an array of CPU percent busy for each CPU, otherwise aggregate all percents into one number
salt '*' ps.cpu_percent
salt.modules.ps.cpu_times(per_cpu=False) Return the percent of time the CPU spends in each state, e.g. user, system, idle, nice, iowait, irq, softirq.
per_cpu if True return an array of percents for each CPU, otherwise aggregate all percents into one number
salt '*' ps.cpu_times
salt.modules.ps.disk_io_counters(device=None) Return disk I/O statistics.
salt '*' ps.disk_io_counters
salt '*' ps.disk_io_counters device=sda1
salt.modules.ps.disk_partition_usage(all=False) Return a list of disk partitions plus the mount point, filesystem and usage statistics.
salt '*' ps.disk_partition_usage
salt.modules.ps.disk_partitions(all=False) Return a list of disk partitions and their device, mount point, and filesystem type.
all    if set to False, only return local, physical partitions (hard disk, USB, CD/DVD partitions).  If True, return all filesystems.
salt '*' ps.disk_partitions
salt.modules.ps.disk_usage(path) Given a path, return a dict listing the total available space as well as the free space, and used space.
salt '*' ps.disk_usage /home
salt.modules.ps.get_pid_list() Return a list of process ids (PIDs) for all running processes.
salt '*' ps.get_pid_list
salt.modules.ps.get_users() Return logged-in users.
salt '*' ps.get_users
salt.modules.ps.kill_pid(pid, signal=15) Kill a process by PID.
salt 'minion' ps.kill_pid pid [signal=signal_number]
pid    PID of process to kill.
signal Signal to send to the process. See manpage entry for kill for possible values. Default: 15 (SIGTERM).
Send SIGKILL to process with PID 2000:
salt 'minion' ps.kill_pid 2000 signal=9
salt.modules.ps.lsof(name) Retrieve the lsof information of the given process name.
salt '*' ps.lsof apache2
salt.modules.ps.netstat(name) Retrieve the netstat information of the given process name.
salt '*' ps.netstat apache2
salt.modules.ps.network_io_counters(interface=None) Return network I/O statistics.
salt '*' ps.network_io_counters
salt '*' ps.network_io_counters interface=eth0
salt.modules.ps.num_cpus() Return the number of CPUs.
salt '*' ps.num_cpus
salt.modules.ps.pgrep(pattern, user=None, full=False, pattern_is_regex=False) Return the pids for processes matching a pattern.
If full is true, the full command line is searched for a match, otherwise only the name of the command is searched.
salt '*' ps.pgrep pattern [user=username] [full=(true|false)]
pattern Pattern to search for in the process list.
user   Limit matches to the given username. Default: All users.
full   A boolean value indicating whether only the name of the command or the full command line should be matched against the pattern.
pattern_is_regex This flag enables ps.pgrep to mirror the regex search functionality found in the pgrep command line utility.
Find all httpd processes on all 'www' minions:
salt 'www.*' ps.pgrep httpd
Find all bash processes owned by user 'tom':
salt '*' ps.pgrep bash user=tom
salt.modules.ps.pkill(pattern, user=None, signal=15, full=False) Kill processes matching a pattern.
salt '*' ps.pkill pattern [user=username] [signal=signal_number] \ [full=(true|false)]
signal Signal to send to the process(es). See manpage entry for kill for possible values. Default: 15 (SIGTERM).
Send SIGHUP to all httpd processes on all 'www' minions:
salt 'www.*' ps.pkill httpd signal=1
Send SIGKILL to all bash processes owned by user 'tom':
salt '*' ps.pkill bash signal=9 user=tom
salt.modules.ps.proc_info(pid, attrs=None) Return a dictionary of information for a process id (PID).
salt '*' ps.proc_info 2322 salt '*' ps.proc_info 2322 attrs='["pid", "name"]'
pid    PID of process to query.
attrs  Optional list of desired process attributes.  The list of possible attributes can be found here: http://pythonhosted.org/psutil/#psutil.Process
salt.modules.ps.psaux(name) Retrieve information corresponding to a "ps aux" filtered with the given pattern. It could be just a name or a regular expression (using python search from "re" module).
salt '*' ps.psaux www-data.+apache2
salt.modules.ps.ss(name) Retrieve the ss information of the given process name.
salt '*' ps.ss apache2
salt.modules.ps.swap_memory() New in version 2014.7.0.
Return a dict that describes swap memory statistics.
NOTE: This function is only available in psutil version 0.6.0 and above.
salt '*' ps.swap_memory
salt.modules.ps.top(num_processes=5, interval=3) Return a list of top CPU consuming processes during the interval. num_processes = return the top N CPU consuming processes interval = the number of seconds to sample CPU usage over
salt '*' ps.top
salt '*' ps.top 5 10
salt.modules.ps.total_physical_memory() Return the total number of bytes of physical memory.
salt '*' ps.total_physical_memory
salt.modules.ps.virtual_memory() New in version 2014.7.0.
Return a dict that describes statistics about system memory usage.
salt '*' ps.virtual_memory
salt.modules.publish Publish a command from a minion to a target
salt.modules.publish.full_data(tgt, fun, arg=None, tgt_type='glob', returner='', timeout=5) Return the full data about the publication, this is invoked in the same way as the publish function
salt system.example.com publish.full_data '*' cmd.run 'ls -la /tmp'
If you need to pass a value to a function argument and that value contains an equal sign, you must include the argument name.  For example:
salt '*' publish.full_data test.kwarg arg='cheese=spam'
salt.modules.publish.publish(tgt, fun, arg=None, tgt_type='glob', returner='', timeout=5, via_master=None) Publish a command from the minion out to other minions.
Publications need to be enabled on the Salt master and the minion needs to have permission to publish the command. The Salt master will also prevent a recursive publication loop, this means that a minion cannot command another minion to command another minion as that would create an infinite command loop.
The tgt_type argument is used to pass a target other than a glob into the execution, the available options are:
• glob
• pcre
• grain
• grain_pcre
• pillar_pcre
• ipcidr
• range
• compound
Changed in version 2017.7.0: The expr_form argument has been renamed to tgt_type, earlier releases must use expr_form.
Note that for pillar matches must be exact, both in the pillar matcher and the compound matcher. No globbing is supported.
The arguments sent to the minion publish function are separated with commas. This means that for a minion executing a command with multiple args it will look like this:
salt system.example.com publish.publish '*' user.add 'foo,1020,1020' salt system.example.com publish.publish 'os:Fedora' network.interfaces '' grain
salt system.example.com publish.publish '*' cmd.run 'ls -la /tmp'
salt '*' publish.publish test.kwarg arg='cheese=spam'
Multiple keyword arguments should be passed as a list.
salt '*' publish.publish test.kwarg arg="['cheese=spam','spam=cheese']"
When running via salt-call, the via_master flag may be set to specific which master the publication should be sent to. Only one master may be specified. If unset, the publication will be sent only to the first master in minion configuration.
salt.modules.publish.runner(fun, arg=None, timeout=5) Execute a runner on the master and return the data from the runner function
salt publish.runner manage.down
salt.modules.puppet Execute puppet routines
salt.modules.puppet.disable(message=None) New in version 2014.7.0.
Disable the puppet agent
message New in version 2015.5.2.
Disable message to send to puppet
salt '*' puppet.disable salt '*' puppet.disable 'Disabled, contact XYZ before enabling'
salt.modules.puppet.enable() New in version 2014.7.0.
Enable the puppet agent
salt '*' puppet.enable
salt.modules.puppet.fact(name, puppet=False) Run facter for a specific fact
salt '*' puppet.fact kernel
salt.modules.puppet.facts(puppet=False) Run facter and return the results
salt '*' puppet.facts
salt.modules.puppet.noop(*args, **kwargs) Execute a puppet noop run and return a dict with the stderr, stdout, return code, etc. Usage is the same as for puppet.run.
salt '*' puppet.noop salt '*' puppet.noop tags=basefiles::edit,apache::server salt '*' puppet.noop debug salt '*' puppet.noop apply /a/b/manifest.pp modulepath=/a/b/modules tags=basefiles::edit,apache::server
salt.modules.puppet.plugin_sync() Runs a plugin sync between the puppet master and agent
salt '*' puppet.plugin_sync
salt.modules.puppet.run(*args, **kwargs) Execute a puppet run and return a dict with the stderr, stdout, return code, etc. The first positional argument given is checked as a subcommand. Following positional arguments should be ordered with arguments required by the subcommand first, followed by non-keyword arguments.  Tags are specified by a tag keyword and comma separated list of values. -- http://docs.puppetlabs.com/puppet/latest/reference/lang_tags.html