neulab/tldr huggingface dataset:
salt.modules.nxos.unset_role(username, role, **kwargs) Remove role from username.
username Username for role removal
role   Role to remove
salt '*' nxos.unset_role username=daniel role=vdc-admin
salt.modules.nxos_api Execution module to manage Cisco Nexus Switches (NX-OS) over the NX-API
Execution module used to interface the interaction with a remote or local Nexus switch whether we're running in a Proxy Minion or regular Minion (or regular Minion running directly on the Nexus switch).
platform any
NOTE: To be able to use this module you need to enable to NX-API on your switch, by executing feature nxapi in configuration mode.
NOTE: NX-API requires modern NXOS distributions, typically at least 7.0 depending on the hardware. Due to reliability reasons it is recommended to run the most recent version.
Check https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus7000/sw/programmability/guide/b_Cisco_Nexus_7000_Series_NX-OS_Programmability_Guide/b_Cisco_Nexus_7000_Series_NX-OS_Programmability_Guide_chapter_0101.html for more details.
Usage This module can equally be used via the nxos_api Proxy module or directly from an arbitrary (Proxy) Minion that is running on a machine having access to the network device API. Given that there are no external dependencies, this module can very well used when using the regular Salt Minion directly installed on the switch.
When running outside of the nxos_api Proxy (i.e., from another Proxy Minion type, or regular Minion), the NX-API connection arguments can be either specified from the CLI when executing the command, or in a configuration block under the nxos_api key in the configuration opts (i.e., (Proxy) Minion configuration file), or Pillar. The module supports these simultaneously. These fields are the exact same supported by the nxos_api Proxy Module:
transport: https Specifies the type of connection transport to use. Valid values for the connection are http, and  https.
username: admin The username to pass to the device to authenticate the NX-API connection.
password The password to pass to the device to authenticate the NX-API connection.
port   The TCP port of the endpoint for the NX-API connection. If this keyword is not specified, the default value is automatically determined by the transport type (80 for http, or 443 for https).
timeout: 60 Time in seconds to wait for the device to respond. Default: 60 seconds.
verify: True Either a boolean, in which case it controls whether we verify the NX-API TLS certificate, or a string, in which case it must be a path to a CA bundle to use. Defaults to True.
When there is no certificate configuration on the device and this option is set as True (default), the commands will fail with the following error: SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581).  In this case, you either need to configure a proper certificate on the device (recommended), or bypass the checks setting this argument as False with all the security risks considered.
Check https://www.cisco.com/c/en/us/td/docs/switches/datacenter/nexus3000/sw/programmability/6_x/b_Cisco_Nexus_3000_Series_NX-OS_Programmability_Guide/b_Cisco_Nexus_3000_Series_NX-OS_Programmability_Guide_chapter_01.html to see how to properly configure the certificate.
Example (when not running in a nxos_api Proxy Minion):
nxos_api: username: test password: test
In case the username and password are the same on any device you are targeting, the block above (besides other parameters specific to your environment you might need) should suffice to be able to execute commands from outside a nxos_api Proxy, e.g.:
salt-call --local nxos_api.show 'show lldp neighbors' raw_text # The command above is available when running in a regular Minion where Salt is installed
salt '*' nxos_api.show 'show version' raw_text=False
NOTE: Remember that the above applies only when not running in a nxos_api Proxy Minion. If you want to use the nxos_api Proxy, please follow the documentation notes for a proper setup.
salt.modules.nxos_api.config(commands=None, config_file=None, template_engine='jinja', context=None, defaults=None, saltenv='base', **kwargs) Configures the Nexus switch with the specified commands.
WARNING: All the commands will be applied directly into the running-config.
salt '*' nxos_api.config commands="['spanning-tree mode mstp']" salt '*' nxos_api.config config_file=salt://config.txt salt '*' nxos_api.config config_file=https://bit.ly/2LGLcDy context="{'servers': ['1.2.3.4']}"
salt.modules.nxos_api.rpc(commands, method='cli', **kwargs) Execute an arbitrary RPC request via the Nexus API.
salt-call --local nxps_api.rpc 'show version'
salt.modules.nxos_api.show(commands, raw_text=True, **kwargs) Execute one or more show (non-configuration) commands.
salt-call --local nxos_api.show 'show version' salt '*' nxos_api.show 'show bgp sessions' 'show processes' raw_text=False salt 'regular-minion' nxos_api.show 'show interfaces' host=sw01.example.com username=test password=test
salt.modules.nxos_upgrade Execution module to upgrade Cisco NX-OS Switches.
This module supports execution using a Proxy Minion or Native Minion:
1. Proxy Minion: Connect over SSH or NX-API HTTP(S).  See salt.proxy.nxos for proxy minion setup details.
2. Native Minion: Connect over NX-API Unix Domain Socket (UDS). Install the minion inside the GuestShell running on the NX-OS device.
codeauthor Michael G Wiebe
salt.modules.nxos_upgrade.check_upgrade_impact(system_image, kickstart_image=None, issu=True, **kwargs) Display upgrade impact information without actually upgrading the device.
system_image (Mandatory Option) Path on bootflash: to system image upgrade file.
kickstart_image Path on bootflash: to kickstart image upgrade file.  (Not required if using combined system/kickstart image file) Default: None
issu   In Service Software Upgrade (non-disruptive). When True, the upgrade will abort if issu is not possible.  When False: Force (disruptive) Upgrade/Downgrade.  Default: True
timeout Timeout in seconds for long running 'install all' impact command.  Default: 900
error_pattern Use the option to pass in a regular expression to search for in the output of the 'install all impact' command that indicates an error has occurred.  This option is only used when proxy minion connection type is ssh and otherwise ignored.
salt 'n9k' nxos.check_upgrade_impact system_image=nxos.9.2.1.bin salt 'n7k' nxos.check_upgrade_impact system_image=n7000-s2-dk9.8.1.1.bin \ kickstart_image=n7000-s2-kickstart.8.1.1.bin issu=False
salt.modules.nxos_upgrade.upgrade(system_image, kickstart_image=None, issu=True, **kwargs) Upgrade NX-OS switch.
issu   Set this option to True when an In Service Software Upgrade or non-disruptive upgrade is required. The upgrade will abort if issu is not possible.  Default: True
timeout Timeout in seconds for long running 'install all' upgrade command.  Default: 900
error_pattern Use the option to pass in a regular expression to search for in the output of the 'install all upgrade command that indicates an error has occurred.  This option is only used when proxy minion connection type is ssh and otherwise ignored.
salt 'n9k' nxos.upgrade system_image=nxos.9.2.1.bin salt 'n7k' nxos.upgrade system_image=n7000-s2-dk9.8.1.1.bin \ kickstart_image=n7000-s2-kickstart.8.1.1.bin issu=False
salt.modules.omapi This module interacts with an ISC DHCP Server via OMAPI.  server_ip and server_port params may be set in the minion config or pillar:
omapi.server_ip: 127.0.0.1 omapi.server_port: 7991
depends pypureomapi Python module
salt.modules.omapi.add_host(mac, name=None, ip=None, ddns=False, group=None, supersede_host=False) Add a host object for the given mac.
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1
Add ddns-hostname and a fixed-ip statements:
salt dhcp-server omapi.add_host ab:ab:ab:ab:ab:ab name=host1 ip=10.1.1.1 ddns=true
salt.modules.omapi.delete_host(mac=None, name=None) Delete the host with the given mac or name.
salt dhcp-server omapi.delete_host name=host1 salt dhcp-server omapi.delete_host mac=ab:ab:ab:ab:ab:ab
salt.modules.openbsd_sysctl Module for viewing and modifying OpenBSD sysctl parameters
salt.modules.openbsd_sysctl.assign(name, value) Assign a single sysctl parameter for this minion
salt '*' sysctl.assign net.inet.ip.forwarding 1
salt.modules.openbsd_sysctl.get(name) Return a single sysctl parameter for this minion
salt.modules.openbsd_sysctl.persist(name, value, config='/etc/sysctl.conf') Assign and persist a simple sysctl parameter for this minion
salt '*' sysctl.persist net.inet.ip.forwarding 1
salt.modules.openbsd_sysctl.show(config_file=False) Return a list of sysctl parameters for this minion
salt.modules.openbsdpkg Package support for OpenBSD
NOTE: The package repository is configured on each host using /etc/installurl from OpenBSD 6.1 onwards. Earlier releases relied on /etc/pkg.conf.
Changed in version 2016.3.5: Package versions on OpenBSD are not normally specified explicitly; instead packages may be available in multiple flavors, and branches which are specified by the format of the package name. This module allows you to use the same formatting as pkg_add(1), and will select the empty flavor and default branch by default. Examples:
- rsync - vim--no_x11 - ruby%2.3
salt.modules.openbsdpkg.install(name=None, pkgs=None, sources=None, **kwargs) Install the passed package
CLI Example, Install one package:
CLI Example, Install more than one package:
salt '*' pkg.install pkgs='["<package name>", "<package name>"]'
CLI Example, Install more than one package from a alternate source (e.g.  salt file-server, HTTP, FTP, local filesystem):
salt '*' pkg.install sources='[{"<pkg name>": "salt://pkgs/<pkg filename>"}]'
salt.modules.openbsdpkg.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 '*' pkg.latest_version <package name>
salt.modules.openbsdpkg.list_pkgs(versions_as_list=False, **kwargs) List the packages currently installed as a dict:
salt.modules.openbsdpkg.purge(name=None, pkgs=None, **kwargs) Remove a package and extra configuration files.
salt.modules.openbsdpkg.remove(name=None, pkgs=None, purge=False, **kwargs) Remove a single package with pkg_delete
salt.modules.openbsdpkg.upgrade(name=None, pkgs=None, **kwargs) Run a full package upgrade (pkg_add -u), or upgrade a specific package if name or pkgs is provided.  name is ignored when pkgs is specified.
salt '*' pkg.upgrade salt '*' pkg.upgrade python%2.7
salt.modules.openbsdpkg.upgrade_available(name, **kwargs) Check whether or not an upgrade is available for a given package
salt.modules.openbsdpkg.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.openbsdrcctl_service.py The rcctl service module for OpenBSD
salt.modules.openbsdrcctl_service.available(name) Return True if the named service is available.
salt.modules.openbsdrcctl_service.disable(name, **kwargs) Disable the named service to not start at boot.
salt.modules.openbsdrcctl_service.disabled(name) Return True if the named service is disabled at boot, False otherwise.
salt.modules.openbsdrcctl_service.enable(name, **kwargs) Enable the named service to start at boot.
flags  None Set optional flags to run the service with.
service.flags can be used to change the default flags.
salt '*' service.enable <service name> salt '*' service.enable <service name> flags=<flags>
salt.modules.openbsdrcctl_service.enabled(name, **kwargs) Return True if the named service is enabled at boot and the provided flags match the configured ones (if any). Return False otherwise.
salt '*' service.enabled <service name> salt '*' service.enabled <service name> flags=<flags>
salt.modules.openbsdrcctl_service.get_all() Return all installed services.
salt.modules.openbsdrcctl_service.get_disabled() Return what services are available but not enabled to start at boot.
salt.modules.openbsdrcctl_service.get_enabled() Return what services are set to run on boot.
salt.modules.openbsdrcctl_service.missing(name) The inverse of service.available.  Return True if the named service is not available.
salt.modules.openbsdrcctl_service.reload_(name) Reload the named service.
salt.modules.openbsdrcctl_service.restart(name) Restart the named service.
salt.modules.openbsdrcctl_service.start(name) Start the named service.
salt.modules.openbsdrcctl_service.status(name, sig=None) Return the status for a service, returns a bool whether the service is running.
salt.modules.openbsdrcctl_service.stop(name) Stop the named service.
salt.modules.openbsdservice The service module for OpenBSD
salt.modules.openbsdservice.available(name) New in version 2014.7.0.
Returns True if the specified service is available, otherwise returns False.
salt.modules.openbsdservice.disabled(name) New in version 2014.7.0.
Return True if the named service is disabled, false otherwise
salt.modules.openbsdservice.enabled(name, **kwargs) New in version 2014.7.0.
Return True if the named service is enabled, false otherwise
salt.modules.openbsdservice.get_all() New in version 2014.7.0.
Return all available boot services
salt.modules.openbsdservice.get_disabled() New in version 2014.7.0.
Return a set of services that are installed but disabled
salt.modules.openbsdservice.get_enabled() New in version 2014.7.0.
Return a list of service that are enabled on boot
salt.modules.openbsdservice.missing(name) New in version 2014.7.0.
The inverse of service.available.  Returns True if the specified service is not available, otherwise returns False.
salt.modules.openbsdservice.reload_(name) New in version 2014.7.0.
Reload the named service
salt.modules.openbsdservice.restart(name) Restart the named service
salt.modules.openbsdservice.start(name) Start the specified service
salt.modules.openbsdservice.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.openbsdservice.stop(name) Stop the specified service
salt.modules.openscap Module for OpenSCAP Management
salt.modules.openscap.xccdf(params) Run oscap xccdf commands on minions.  It uses cp.push_dir to upload the generated files to the salt master in the master's minion files cachedir (defaults to /var/cache/salt/master/minions/minion-id/files)
It needs file_recv set to True in the master configuration file.
salt '*'  openscap.xccdf "eval --profile Default /usr/share/openscap/scap-yast2sec-xccdf.xml"
salt.modules.openstack_config Modify, retrieve, or delete values from OpenStack configuration files.
maintainer Jeffrey C. Ollie <jeff@ocjtech.us>
salt.modules.openstack_config.delete(filename, section, parameter) Delete a value from an OpenStack configuration file.
filename The full path to the configuration file
section The section from which to delete the parameter
parameter The parameter to delete
salt-call openstack_config.delete /etc/keystone/keystone.conf sql connection
salt.modules.openstack_config.get(filename, section, parameter) Get a value from an OpenStack configuration file.
section The section from which to search for the parameter
parameter The parameter to return
salt-call openstack_config.get /etc/keystone/keystone.conf sql connection
salt.modules.openstack_config.set_(filename, section, parameter, value) Set a value in an OpenStack configuration file.
section The section in which the parameter will be set
parameter The parameter to change
value  The value to set
salt-call openstack_config.set /etc/keystone/keystone.conf sql connection foo
salt.modules.openstack_mng Module for OpenStack Management
codeauthor Konrad Mosoń <mosonkonrad@gmail.com>
depends openstack-utils
salt.modules.openstack_mng.restart_service(service_name, minimum_running_time=None) Restart OpenStack service immediately, or only if it's running longer than specified value
salt '*' openstack_mng.restart_service neutron salt '*' openstack_mng.restart_service neutron minimum_running_time=600
salt.modules.openstack_mng.start_service(service_name) Start OpenStack service immediately
salt '*' openstack_mng.start_service neutron
salt.modules.openstack_mng.stop_service(service_name) Stop OpenStack service immediately
salt '*' openstack_mng.stop_service neutron
salt.modules.openvswitch Support for Open vSwitch - module with basic Open vSwitch commands.
Suitable for setting up Openstack Neutron.
codeauthor Jiri Kotlin <jiri.kotlin@ultimum.io>
salt.modules.openvswitch.bridge_create(br, may_exist=True) Creates a new bridge.
• br -- A string - bridge name
• may_exist -- Bool, if False - attempting to create a bridge that exists returns False.
Returns True on success, else False.
salt '*' openvswitch.bridge_create br0
salt.modules.openvswitch.bridge_delete(br, if_exists=True) Deletes bridge and all of  its  ports.
• if_exists -- Bool, if False - attempting to delete a bridge that does not exist returns False.
salt '*' openvswitch.bridge_delete br0
salt.modules.openvswitch.bridge_exists(br) Tests whether bridge exists as a real or fake  bridge.
Returns True if Bridge exists, else False.
salt '*' openvswitch.bridge_exists br0
salt.modules.openvswitch.bridge_list() Lists all existing real and fake bridges.
Returns List of bridges (or empty list), False on failure.
salt '*' openvswitch.bridge_list
salt.modules.openvswitch.interface_get_options(port) Port's interface's optional parameters.
Parameters port -- A string - port name.
Returns String containing optional parameters of port's interface, False on failure.
salt '*' openvswitch.interface_get_options tap0
salt.modules.openvswitch.interface_get_type(port) Type of port's interface.
Returns String - type of interface or empty string, False on failure.
salt '*' openvswitch.interface_get_type tap0
salt.modules.openvswitch.port_add(br, port, may_exist=False, internal=False) Creates on bridge a new port named port.
• port -- A string - port name
• may_exist -- Bool, if False - attempting to create a port that exists returns False.
• internal -- A boolean to create an internal interface if one does not exist.
salt '*' openvswitch.port_add br0 8080
salt.modules.openvswitch.port_create_gre(br, port, id, remote) Generic Routing Encapsulation - creates GRE tunnel between endpoints.
• br -- A string - bridge name.
• port -- A string - port name.
• id -- An integer - unsigned 32-bit number, tunnel's key.
• remote -- A string - remote endpoint's IP address.
salt '*' openvswitch.port_create_gre br0 gre1 5001 192.168.1.10
salt.modules.openvswitch.port_create_vlan(br, port, id, internal=False) Isolate VM traffic using VLANs.
• id -- An integer in the valid range 0 to 4095 (inclusive), name of VLAN.
salt '*' openvswitch.port_create_vlan br0 tap0 100
salt.modules.openvswitch.port_create_vxlan(br, port, id, remote, dst_port=None) Virtual eXtensible Local Area Network - creates VXLAN tunnel between endpoints.
• id -- An integer - unsigned 64-bit number, tunnel's key.
• dst_port -- An integer - port to use when creating tunnelport in the switch.
salt '*' openvswitch.port_create_vxlan br0 vx1 5001 192.168.1.10 8472
salt.modules.openvswitch.port_get_tag(port) Lists tags of the port.
Returns List of tags (or empty list), False on failure.
salt '*' openvswitch.port_get_tag tap0
salt.modules.openvswitch.port_list(br) Lists all of the ports within bridge.
Parameters br -- A string - bridge name.
salt '*' openvswitch.port_list br0
salt.modules.openvswitch.port_remove(br, port, if_exists=True) Deletes port.
• br -- A string - bridge name (If bridge is None, port is removed from  whatever bridge contains it)
• if_exists -- Bool, if False - attempting to delete a por that  does  not exist returns False. (Default True)
salt '*' openvswitch.port_remove br0 8080
salt.modules.opkg Support for Opkg
NOTE: For version comparison support on opkg < 0.3.4, the opkg-utils package must be installed.
salt.modules.opkg.available_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.opkg.check_extra_requirements(pkgname, pkgver) Check if the installed package already has the given requirements. There's nothing do to here for nipkg.py, therefore it will always return True.
salt.modules.opkg.del_repo(repo, **kwargs) Delete a repo from /etc/opkg/*.conf
If the file does not contain any other repo configuration, the file itself will be deleted.
salt '*' pkg.del_repo repo
salt.modules.opkg.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.opkg.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.opkg.get_repo(repo, **kwargs) Display a repo from the /etc/opkg/*.conf
salt '*' pkg.get_repo repo
salt.modules.opkg.hold(name=None, pkgs=None, sources=None, **kwargs) Set package in 'hold' state, meaning it will not be upgraded.
salt.modules.opkg.info_installed(*names, **kwargs) Return the information of the named package(s), installed on the system.
• names -- Names of the packages to get information about. If none are specified, will return information for all installed packages.
• attr --
Comma-separated package attributes. If no 'attr' is specified, all available attributes returned.
Valid attributes are: arch, conffiles, conflicts, depends, description, filename, group, install_date_time_t, md5sum, packager, provides, recommends, replaces, size, source, suggests, url, version
salt '*' pkg.info_installed salt '*' pkg.info_installed attr=version,packager salt '*' pkg.info_installed <package1> salt '*' pkg.info_installed <package1> <package2> <package3> ... salt '*' pkg.info_installed <package1> attr=version,packager salt '*' pkg.info_installed <package1> <package2> <package3> ... attr=version,packager
salt.modules.opkg.install(name=None, refresh=False, pkgs=None, sources=None, reinstall=False, **kwargs) Install the passed package, add refresh=True to update the opkg database.
reinstall False Specifying reinstall=True will use opkg install --force-reinstall rather than simply opkg install for requested packages that are already installed.
If a version is specified with the requested package, then opkg install --force-reinstall will only be used if the installed version matches the requested version.
only_upgrade Only upgrade the packages (disallow downgrades), if they are already installed. Default is False.
salt.modules.opkg.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.opkg.list_pkgs(versions_as_list=False, **kwargs) List the packages currently installed in a dict:
salt.modules.opkg.list_repos(**kwargs) Lists all repos on /etc/opkg/*.conf
salt '*' pkg.list_repos
salt.modules.opkg.list_upgrades(refresh=True, **kwargs) List all available package upgrades.
salt.modules.opkg.mod_repo(repo, **kwargs) Modify one or more values for a repo.  If the repo does not exist, it will be created, so long as uri is defined.
repo   alias by which opkg refers to the repo.
uri    the URI to the repo.
compressed defines (True or False) if the index file is compressed
enabled enable or disable (True or False) repository but do not remove if disabled.
refresh enable or disable (True or False) auto-refresh of the repositories
salt '*' pkg.mod_repo repo uri=http://new/uri salt '*' pkg.mod_repo repo enabled=False
salt.modules.opkg.owner(*paths, **kwargs) Return the name of the package that owns the file. Multiple file paths can be passed. Like pkg.version <salt.modules.opkg.version, if a single path is passed, a string will be returned, and if multiple paths are passed, a dictionary of file/package name pairs will be returned.
salt.modules.opkg.purge(name=None, pkgs=None, **kwargs) Package purges are not supported by opkg, this function is identical to pkg.remove.
salt.modules.opkg.refresh_db(failhard=False, **kwargs) Updates the opkg database to latest packages based upon repositories
failhard If False, return results of failed lines as False for the package database that encountered the error.  If True, raise an error with a list of the package databases that encountered errors.
salt.modules.opkg.remove(name=None, pkgs=None, **kwargs) Remove packages using opkg remove.
remove_dependencies Remove package and all dependencies
auto_remove_deps Remove packages that were installed automatically to satisfy dependencies
salt '*' pkg.remove <package name> salt '*' pkg.remove <package1>,<package2>,<package3> salt '*' pkg.remove pkgs='["foo", "bar"]' salt '*' pkg.remove pkgs='["foo", "bar"]' remove_dependencies=True auto_remove_deps=True
salt.modules.opkg.unhold(name=None, pkgs=None, sources=None, **kwargs) Set package current in 'hold' state to install state, meaning it will be upgraded.
salt.modules.opkg.upgrade(refresh=True, **kwargs) Upgrades all packages via opkg upgrade
salt.modules.opkg.upgrade_available(name, **kwargs) Check whether or not an upgrade is available for a given package
salt.modules.opkg.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.opkg.version_clean(version) Clean the version string removing extra data.  There's nothing do to here for nipkg.py, therefore it will always return the given version.
salt.modules.opkg.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.modules.opsgenie Module for sending data to OpsGenie
configuration This module can be used in Reactor System for posting data to OpsGenie as a remote-execution function.
opsgenie_event_poster: local.opsgenie.post_data: - tgt: 'salt-minion' - kwarg: name: event.reactor api_key: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX reason: {{ data['data']['reason'] }} action_type: Create
salt.modules.opsgenie.post_data(api_key=None, name='OpsGenie Execution Module', reason=None, action_type=None) Post data to OpsGenie. It's designed for Salt's Event Reactor.
After configuring the sls reaction file as shown above, you can trigger the module with your designated tag (og-tag in this case).
salt-call event.send 'og-tag' '{"reason" : "Overheating CPU!"}'
Required parameters:
api_key It's the API Key you've copied while adding integration in OpsGenie.
reason It will be used as alert's default message in OpsGenie.
action_type OpsGenie supports the default values Create/Close for action_type. You can customize this field with OpsGenie's custom actions for other purposes like adding notes or acknowledging alerts.
Optional parameters:
name   It will be used as alert's alias. If you want to use the close functionality you must provide name field for both states like in this case.
salt.modules.oracle Oracle DataBase connection module
maintainer Vladimir Bormotov <bormotov@gmail.com>
depends cx_Oracle
configuration module provide connections for multiple Oracle DB instances.
OS Environment
ORACLE_HOME: path to oracle product PATH: path to Oracle Client libs need to be in PATH
oracle: dbs: <db>: uri: connection credentials in format: user/password@host[:port]/sid[ servicename as {sysdba|sysoper}] optional keyword servicename will determine whether it is a sid or service_name <db>: uri: .....
salt.modules.oracle.client_version() Oracle Client Version
salt '*' oracle.client_version
salt.modules.oracle.run_query(db, query) Run SQL query and return result
salt '*' oracle.run_query my_db "select * from my_table"
salt.modules.oracle.show_dbs(*dbs) Show databases configuration from pillar. Filter by *args
salt '*' oracle.show_dbs salt '*' oracle.show_dbs my_db
salt.modules.oracle.show_env() Show Environment used by Oracle Client
salt '*' oracle.show_env
NOTE: at first _connect() NLS_LANG will forced to '.AL32UTF8'
salt.modules.oracle.show_pillar(item=None) Show Pillar segment oracle.* and subitem with notation "item:subitem"
salt '*' oracle.show_pillar salt '*' oracle.show_pillar dbs:my_db
salt.modules.oracle.version(*dbs) Server Version (select banner  from v$version)
salt '*' oracle.version salt '*' oracle.version my_db
salt.modules.osquery Support for OSQuery - https://osquery.io.
salt.modules.osquery.acpi_tables(attrs=None, where=None) Return acpi_tables information from osquery
salt '*' osquery.acpi_tables
salt.modules.osquery.alf(attrs=None, where=None) Return alf information from osquery
salt '*' osquery.alf
salt.modules.osquery.alf_exceptions(attrs=None, where=None) Return alf_exceptions information from osquery
salt '*' osquery.alf_exceptions
salt.modules.osquery.alf_explicit_auths(attrs=None, where=None) Return alf_explicit_auths information from osquery
salt '*' osquery.alf_explicit_auths
salt.modules.osquery.alf_services(attrs=None, where=None) Return alf_services information from osquery
salt '*' osquery.alf_services
salt.modules.osquery.apps(attrs=None, where=None) Return apps information from osquery
salt '*' osquery.apps
salt.modules.osquery.apt_sources(attrs=None, where=None) Return apt_sources information from osquery
salt '*' osquery.apt_sources
salt.modules.osquery.arp_cache(attrs=None, where=None) Return arp_cache information from osquery
salt '*' osquery.arp_cache
salt.modules.osquery.block_devices(attrs=None, where=None) Return block_devices information from osquery
salt '*' osquery.block_devices
salt.modules.osquery.certificates(attrs=None, where=None) Return certificates information from osquery
salt '*' osquery.certificates
salt.modules.osquery.chrome_extensions(attrs=None, where=None) Return chrome_extensions information from osquery
salt '*' osquery.chrome_extensions
salt.modules.osquery.cpuid(attrs=None, where=None) Return cpuid information from osquery
salt '*' osquery.cpuid
salt.modules.osquery.crontab(attrs=None, where=None) Return crontab information from osquery
salt '*' osquery.crontab
salt.modules.osquery.deb_packages(attrs=None, where=None) Return deb_packages information from osquery
salt '*' osquery.deb_packages
salt.modules.osquery.etc_hosts(attrs=None, where=None) Return etc_hosts information from osquery
salt '*' osquery.etc_hosts
salt.modules.osquery.etc_services(attrs=None, where=None) Return etc_services information from osquery
salt '*' osquery.etc_services
salt.modules.osquery.file_(attrs=None, where=None) Return file information from osquery
salt '*' osquery.file
salt.modules.osquery.file_changes(attrs=None, where=None) Return file_changes information from osquery
salt '*' osquery.file_changes
salt.modules.osquery.firefox_addons(attrs=None, where=None) Return firefox_addons information from osquery
salt '*' osquery.firefox_addons
salt.modules.osquery.groups(attrs=None, where=None) Return groups information from osquery
salt '*' osquery.groups
salt.modules.osquery.hardware_events(attrs=None, where=None) Return hardware_events information from osquery
salt '*' osquery.hardware_events
salt.modules.osquery.hash_(attrs=None, where=None) Return hash information from osquery
salt '*' osquery.hash
salt.modules.osquery.homebrew_packages(attrs=None, where=None) Return homebrew_packages information from osquery
salt '*' osquery.homebrew_packages
salt.modules.osquery.interface_addresses(attrs=None, where=None) Return interface_addresses information from osquery
salt '*' osquery.interface_addresses
salt.modules.osquery.interface_details(attrs=None, where=None) Return interface_details information from osquery
salt '*' osquery.interface_details
salt.modules.osquery.iokit_devicetree(attrs=None, where=None) Return iokit_devicetree information from osquery
salt '*' osquery.iokit_devicetree
salt.modules.osquery.iokit_registry(attrs=None, where=None) Return iokit_registry information from osquery
salt '*' osquery.iokit_registry
salt.modules.osquery.kernel_extensions(attrs=None, where=None) Return kernel_extensions information from osquery
salt '*' osquery.kernel_extensions
salt.modules.osquery.kernel_info(attrs=None, where=None) Return kernel_info information from osquery
salt '*' osquery.kernel_info
salt.modules.osquery.kernel_integrity(attrs=None, where=None) Return kernel_integrity information from osquery
salt '*' osquery.kernel_integrity
salt.modules.osquery.kernel_modules(attrs=None, where=None) Return kernel_modules information from osquery
salt '*' osquery.kernel_modules
salt.modules.osquery.keychain_items(attrs=None, where=None) Return keychain_items information from osquery
salt '*' osquery.keychain_items
salt.modules.osquery.last(attrs=None, where=None) Return last information from osquery
salt '*' osquery.last
salt.modules.osquery.launchd(attrs=None, where=None) Return launchd information from osquery
salt '*' osquery.launchd
salt.modules.osquery.listening_ports(attrs=None, where=None) Return listening_ports information from osquery
salt '*' osquery.listening_ports
salt.modules.osquery.logged_in_users(attrs=None, where=None) Return logged_in_users information from osquery
salt '*' osquery.logged_in_users
salt.modules.osquery.memory_map(attrs=None, where=None) Return memory_map information from osquery
salt '*' osquery.memory_map
salt.modules.osquery.mounts(attrs=None, where=None) Return mounts information from osquery
salt '*' osquery.mounts
salt.modules.osquery.nfs_shares(attrs=None, where=None) Return nfs_shares information from osquery
salt '*' osquery.nfs_shares
salt.modules.osquery.nvram(attrs=None, where=None) Return nvram information from osquery
salt '*' osquery.nvram
salt.modules.osquery.os_version(attrs=None, where=None) Return os_version information from osquery
salt '*' osquery.os_version
salt.modules.osquery.osquery_extensions(attrs=None, where=None) Return osquery_extensions information from osquery
salt '*' osquery.osquery_extensions
salt.modules.osquery.osquery_flags(attrs=None, where=None) Return osquery_flags information from osquery
salt '*' osquery.osquery_flags
salt.modules.osquery.osquery_info(attrs=None, where=None) Return osquery_info information from osquery
salt '*' osquery.osquery_info
salt.modules.osquery.osquery_registry(attrs=None, where=None) Return osquery_registry information from osquery
salt '*' osquery.osquery_registry
salt.modules.osquery.passwd_changes(attrs=None, where=None) Return passwd_changes information from osquery
salt '*' osquery.passwd_changes
salt.modules.osquery.pci_devices(attrs=None, where=None) Return pci_devices information from osquery
salt '*' osquery.pci_devices
salt.modules.osquery.preferences(attrs=None, where=None) Return preferences information from osquery
salt '*' osquery.preferences
salt.modules.osquery.process_envs(attrs=None, where=None) Return process_envs information from osquery
salt '*' osquery.process_envs
salt.modules.osquery.process_memory_map(attrs=None, where=None) Return process_memory_map information from osquery
salt '*' osquery.process_memory_map
salt.modules.osquery.process_open_files(attrs=None, where=None) Return process_open_files information from osquery
salt '*' osquery.process_open_files
salt.modules.osquery.process_open_sockets(attrs=None, where=None) Return process_open_sockets information from osquery
salt '*' osquery.process_open_sockets
salt.modules.osquery.processes(attrs=None, where=None) Return processes information from osquery
salt '*' osquery.processes
salt.modules.osquery.quarantine(attrs=None, where=None) Return quarantine information from osquery
salt '*' osquery.quarantine
salt.modules.osquery.query(sql=None) Return time information from osquery
salt '*' osquery.query "select * from users;"
salt.modules.osquery.routes(attrs=None, where=None) Return routes information from osquery
salt '*' osquery.routes
salt.modules.osquery.rpm_packages(attrs=None, where=None) Return cpuid information from osquery
salt '*' osquery.rpm_packages
salt.modules.osquery.safari_extensions(attrs=None, where=None) Return safari_extensions information from osquery
salt '*' osquery.safari_extensions
salt.modules.osquery.shared_memory(attrs=None, where=None) Return shared_memory information from osquery
salt '*' osquery.shared_memory
salt.modules.osquery.shell_history(attrs=None, where=None) Return shell_history information from osquery
salt '*' osquery.shell_history
salt.modules.osquery.smbios_tables(attrs=None, where=None) Return smbios_tables information from osquery
salt '*' osquery.smbios_tables
salt.modules.osquery.startup_items(attrs=None, where=None) Return startup_items information from osquery
salt '*' osquery.startup_items
salt.modules.osquery.suid_bin(attrs=None, where=None) Return suid_bin information from osquery
salt '*' osquery.suid_bin
salt.modules.osquery.system_controls(attrs=None, where=None) Return system_controls information from osquery
salt '*' osquery.system_controls
salt.modules.osquery.time_(attrs=None) Return time information from osquery
salt '*' osquery.time
salt.modules.osquery.usb_devices(attrs=None, where=None) Return usb_devices information from osquery
salt '*' osquery.usb_devices
salt.modules.osquery.users(attrs=None, where=None) Return users information from osquery
salt '*' osquery.users
salt.modules.osquery.version() Return version of osquery
salt '*' osquery.version
salt.modules.osquery.xattr_where_from(attrs=None, where=None) Return xattr_where_from information from osquery
salt '*' osquery.xattr_where_from
salt.modules.osquery.xprotect_entries(attrs=None, where=None) Return xprotect_entries information from osquery
salt '*' osquery.xprotect_entries
salt.modules.osquery.xprotect_reports(attrs=None, where=None) Return xprotect_reports information from osquery
salt '*' osquery.xprotect_reports
salt.modules.out Output Module New in version 2018.3.0.
Execution module that processes JSON serializable data and returns string having the format as processed by the outputters.
Although this does not bring much value on the CLI, it turns very handy in applications that require human readable data rather than Python objects.
For example, inside a Jinja template:
{{ salt.out.string_format(complex_object, out='highstate') }}
salt.modules.out.html_format(data, out='nested', opts=None, **kwargs) Return the formatted string as HTML.
data   The JSON serializable object.
out: nested The name of the output to use to transform the data. Default: nested.
opts   Dictionary of configuration options. Default: __opts__.
kwargs Arguments to sent to the outputter module.
salt '*' out.html_format "{'key': 'value'}" out=yaml
salt.modules.out.out_format(data, out='nested', opts=None, **kwargs) Return the formatted outputter string for the Python object.
salt '*' out.out_format "{'key': 'value'}"
salt.modules.out.string_format(data, out='nested', opts=None, **kwargs) Return the outputter formatted string, removing the ANSI escape sequences.
salt '*' out.string_format "{'key': 'value'}" out=table
salt.modules.pacmanpkg A module to wrap pacman calls, since Arch is the best (‐ https://wiki.archlinux.org/index.php/Arch_is_the_best)
salt.modules.pacmanpkg.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.modules.pacmanpkg.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.pacmanpkg.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.pacmanpkg.group_diff(name) New in version 2016.11.0.
Lists which of a group's packages are installed and which are not installed
Compatible with yumpkg.group_diff for easy support of state.pkg.group_installed
salt '*' pkg.group_diff 'xorg'
salt.modules.pacmanpkg.group_info(name) New in version 2016.11.0.
Lists all packages in the specified group
salt '*' pkg.group_info 'xorg'
salt.modules.pacmanpkg.group_list() New in version 2016.11.0.
Lists all groups known by pacman on this system
salt '*' pkg.group_list
salt.modules.pacmanpkg.install(name=None, refresh=False, sysupgrade=None, pkgs=None, sources=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any pacman commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Install (pacman -S) the specified packag(s). Add refresh=True to install with -y, add sysupgrade=True to install with -u.
name   The name of the package to be installed. Note that this parameter is ignored if either pkgs or sources is passed. Additionally, please note that this option can only be used to install packages from a software repository. To install a package file manually, use the sources option.
sysupgrade Whether or not to upgrade the system packages before installing.  If refresh is set to True but sysupgrade is not specified, -u will be applied
pkgs   A list of packages to install from a software repository. Must be passed as a python list. A specific version number can be specified by using a single-element dict representing the package and its version. As with the version parameter above, comparison operators can be used to target a specific version of a package.
salt '*' pkg.install pkgs='["foo", "bar"]' salt '*' pkg.install pkgs='["foo", {"bar": "1.2.3-4"}]' salt '*' pkg.install pkgs='["foo", {"bar": "<1.2.3-4"}]'
salt '*' pkg.install                 sources='[{"foo": "salt://foo.pkg.tar.xz"},                 {"bar": "salt://bar.pkg.tar.xz"}]'
salt.modules.pacmanpkg.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.pacmanpkg.list_pkgs(versions_as_list=False, **kwargs) List the packages currently installed as a dict:
salt.modules.pacmanpkg.list_repo_pkgs(*args, **kwargs) Returns all available packages. Optionally, package names (and name globs) can be passed and the results will be filtered to packages matching those names.
The return data will be a dictionary mapping package names to a list of version numbers, ordered from newest to oldest. If byrepo is set to True, then the return dictionary will contain repository names at the top level, and each repository will map packages to lists of version numbers. For example:
# With byrepo=False (default) { 'bash': ['4.4.005-2'], 'nginx': ['1.10.2-2'] } # With byrepo=True { 'core': { 'bash': ['4.4.005-2'] }, 'extra': { 'nginx': ['1.10.2-2'] } }
fromrepo None Only include results from the specified repo(s). Multiple repos can be specified, comma-separated.
byrepo False When True, the return data for each package will be organized by repository.
refresh False When True, the package database will be refreshed (i.e. pacman -Sy) before checking for available versions.
salt '*' pkg.list_repo_pkgs salt '*' pkg.list_repo_pkgs foo bar baz salt '*' pkg.list_repo_pkgs 'samba4*' fromrepo=base,updates salt '*' pkg.list_repo_pkgs 'python2-*' byrepo=True
salt.modules.pacmanpkg.list_upgrades(refresh=False, root=None, **kwargs) List all available package upgrades on this system
salt.modules.pacmanpkg.owner(*paths, **kwargs) New in version 2014.7.0.
salt '*' pkg.owner /usr/bin/apachectl salt '*' pkg.owner /usr/bin/apachectl /usr/bin/zsh
salt.modules.pacmanpkg.purge(name=None, pkgs=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any pacman commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Recursively remove a package and all dependencies which were installed with it, this will call a pacman -Rsc
salt.modules.pacmanpkg.refresh_db(root=None, **kwargs) Just run a pacman -Sy, return a dict:
{'<database name>': Bool}
salt.modules.pacmanpkg.remove(name=None, pkgs=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any pacman commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Remove packages with pacman -R.
salt.modules.pacmanpkg.upgrade(refresh=False, root=None, **kwargs) Changed in version 2015.8.12,2016.3.3,2016.11.0: On minions running systemd>=205, systemd-run(1) is now used to isolate commands which modify installed packages from the salt-minion daemon's control group. This is done to keep systemd from killing any pacman commands spawned by Salt when the salt-minion service is restarted. (see KillMode in the systemd.kill(5) manpage for more information). If desired, usage of systemd-run(1) can be suppressed by setting a config option called systemd.scope, with a value of False (no quotes).
Run a full system upgrade, a pacman -Syu
salt.modules.pacmanpkg.upgrade_available(name, **kwargs) Check whether or not an upgrade is available for a given package
salt.modules.pacmanpkg.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.pagerduty Module for Firing Events via PagerDuty
configuration This module can be used by specifying the name of a configuration profile in the minion config, minion pillar, or master config.
my-pagerduty-account: pagerduty.api_key: F3Rbyjbve43rfFWf2214 pagerduty.subdomain: mysubdomain
salt.modules.pagerduty.create_event(service_key=None, description=None, details=None, incident_key=None, profile=None) Create an event in PagerDuty. Designed for use in states.
salt myminion pagerduty.create_event <service_key> <description> <details>         profile=my-pagerduty-account
The following parameters are required:
service_key This key can be found by using pagerduty.list_services.
description This is a short description of the event.
details This can be a more detailed description of the event.
profile This refers to the configuration profile to use to connect to the PagerDuty service.
salt.modules.pagerduty.list_escalation_policies(profile=None, api_key=None) This function is an alias of list_policies. List escalation policies belonging to this account
salt myminion pagerduty.list_policies my-pagerduty-account salt myminion pagerduty.list_escalation_policies my-pagerduty-account
salt.modules.pagerduty.list_incidents(profile=None, api_key=None) List incidents belonging to this account
salt myminion pagerduty.list_incidents my-pagerduty-account
salt.modules.pagerduty.list_maintenance_windows(profile=None, api_key=None) This function is an alias of list_windows. List maintenance windows belonging to this account
salt myminion pagerduty.list_windows my-pagerduty-account salt myminion pagerduty.list_maintenance_windows my-pagerduty-account
salt.modules.pagerduty.list_policies(profile=None, api_key=None) List escalation policies belonging to this account
salt.modules.pagerduty.list_schedules(profile=None, api_key=None) List schedules belonging to this account
salt myminion pagerduty.list_schedules my-pagerduty-account
salt.modules.pagerduty.list_services(profile=None, api_key=None) List services belonging to this account
salt myminion pagerduty.list_services my-pagerduty-account