neulab/tldr huggingface dataset:
salt.modules.infoblox.get_object(objref, data=None, return_fields=None, max_results=None, ensure_none_or_one_result=False, **api_opts) Get raw infoblox object. This is a low level api call.
salt-call infoblox.get_object objref=[_ref of object]
salt.modules.infoblox.is_ipaddr_in_ipfunc_range(ipaddr, ipfunc) Return true if the ipaddress is in the range of the nextavailableip function
salt-call infoblox.is_ipaddr_in_ipfunc_range             ipaddr="10.0.2.2" ipfunc="func:nextavailableip:10.0.0.0/8"
salt.modules.infoblox.update_cname(name, data, **api_opts) Update CNAME. This is a helper call to update_object.
Find a CNAME _ref then call update_object with the record data.
salt-call infoblox.update_cname name=example.example.com data="{ 'canonical':'example-ha-0.example.com', 'use_ttl':true, 'ttl':200, 'comment':'Salt managed CNAME'}"
salt.modules.infoblox.update_host(name, data, **api_opts) Update host record. This is a helper call to update_object.
Find a hosts _ref then call update_object with the record data.
salt-call infoblox.update_host name=fqdn data={}
salt.modules.infoblox.update_object(objref, data, **api_opts) Update raw infoblox object. This is a low level api call.
salt-call infoblox.update_object objref=[ref_of_object] data={}
salt.modules.ini_manage Edit ini files
maintainer <akilesh1597@gmail.com>
depends re
(for example /etc/sysctl.conf)
salt.modules.ini_manage.get_ini(file_name, separator='=') Retrieve whole structure from an ini file and return it as dictionary.
API Example:
import salt.client with salt.client.giet_local_client() as sc: sc.cmd('target', 'ini.get_ini', [path_to_ini_file])
salt '*' ini.get_ini /path/to/ini
salt.modules.ini_manage.get_option(file_name, section, option, separator='=') Get value of a key from a section in an ini file. Returns None if no matching key was found.
import salt.client with salt.client.get_local_client() as sc: sc.cmd('target', 'ini.get_option', [path_to_ini_file, section_name, option])
salt '*' ini.get_option /path/to/ini section_name option_name
salt.modules.ini_manage.get_section(file_name, section, separator='=') Retrieve a section from an ini file. Returns the section as dictionary. If the section is not found, an empty dictionary is returned.
import salt.client with salt.client.get_local_client() as sc: sc.cmd('target', 'ini.get_section', [path_to_ini_file, section_name])
salt '*' ini.get_section /path/to/ini section_name
salt.modules.ini_manage.remove_option(file_name, section, option, separator='=') Remove a key/value pair from a section in an ini file. Returns the value of the removed key, or None if nothing was removed.
import salt sc = salt.client.get_local_client() sc.cmd('target', 'ini.remove_option', [path_to_ini_file, section_name, option])
salt '*' ini.remove_option /path/to/ini section_name option_name
salt.modules.ini_manage.remove_section(file_name, section, separator='=') Remove a section in an ini file. Returns the removed section as dictionary, or None if nothing was removed.
import salt.client with  salt.client.get_local_client() as sc: sc.cmd('target', 'ini.remove_section', [path_to_ini_file, section_name])
salt '*' ini.remove_section /path/to/ini section_name
salt.modules.ini_manage.set_option(file_name, sections=None, separator='=') Edit an ini file, replacing one or more sections. Returns a dictionary containing the changes made.
file_name path of ini_file
sections None A dictionary representing the sections to be edited ini file The keys are the section names and the values are the dictionary containing the options If the ini file does not contain sections the keys and values represent the options
separator = A character used to separate keys and values. Standard ini files use the "=" character.
import salt.client with salt.client.get_local_client() as sc: sc.cmd( 'target', 'ini.set_option', ['path_to_ini_file', '{"section_to_change": {"key": "value"}}'] )
salt '*' ini.set_option /path/to/ini '{section_foo: {key: value}}'
salt.modules.inspectlib package Submodules salt.modules.inspectlib.collector class salt.modules.inspectlib.collector.Inspector(cachedir=None, piddir=None, pidfilename=None)
DEFAULT_MINION_CONFIG_PATH = '/etc/salt/minion'
IGNORE_FS_TYPES = ['autofs', 'cifs', 'nfs', 'nfs4']
IGNORE_MOUNTS = ['proc', 'sysfs', 'devtmpfs', 'tmpfs', 'fuse.gvfs-fuse-daemon']
IGNORE_PATHS = ['/tmp', '/var/tmp', '/lost+found', '/var/run', '/var/lib/rpm', '/.snapshots', '/.zfs', '/etc/ssh', '/root', '/home']
MODE = ['configuration', 'payload', 'all']
build(format='qcow2', path='/tmp') Build an image using Kiwi.
• format --
• path --
create_snapshot() Open new snapshot.
export(description, local=False, path='/tmp', format='qcow2') Export description for Kiwi.
• local --
request_snapshot(mode, priority=19, **kwargs) Take a snapshot of the system.
reuse_snapshot() Open an existing, latest snapshot.
snapshot(mode) Take a snapshot of the system.
salt.modules.inspectlib.collector.is_alive(pidfile) Check if PID is still alive.
salt.modules.inspectlib.collector.main(dbfile, pidfile, mode) Main analyzer routine.
salt.modules.inspectlib.dbhandle class salt.modules.inspectlib.dbhandle.DBHandle(*args, **kwargs)
class salt.modules.inspectlib.dbhandle.DBHandleBase(path) Handle for the volatile database, which serves the purpose of caching the inspected data. This database can be destroyed or corrupted, so it should be simply re-created from scratch.
close() Close the database connection.
flush(table) Flush the table.
open(new=False) Init the database, if required.
purge() Purge whole database.
salt.modules.inspectlib.exceptions exception salt.modules.inspectlib.exceptions.InspectorKiwiProcessorException Kiwi builder/exporter exception.
exception salt.modules.inspectlib.exceptions.InspectorQueryException Exception that is only for the inspector query.
exception salt.modules.inspectlib.exceptions.InspectorSnapshotException Snapshot exception.
exception salt.modules.inspectlib.exceptions.SIException System information exception.
salt.modules.inspectlib.query class salt.modules.inspectlib.query.Query(scope, cachedir=None) Query the system.  This class is actually puts all Salt features together, so there would be no need to pick it from various places.
SCOPES = ['changes', 'configuration', 'identity', 'system', 'software', 'services', 'payload', 'all']
class salt.modules.inspectlib.query.SysInfo(systype) System information.
Module contents class salt.modules.inspectlib.EnvLoader(cachedir=None, piddir=None, pidfilename=None) Load environment.
DB_FILE = '_minion_collector.db'
DEFAULT_CACHE_PATH = '/var/cache/salt'
DEFAULT_PID_PATH = '/var/run'
PID_FILE = '_minion_collector.pid'
salt.modules.inspectlib.entities class salt.modules.inspectlib.entities.AllowedDir Allowed directories
class salt.modules.inspectlib.entities.IgnoredDir Ignored directories
class salt.modules.inspectlib.entities.Package Package.
class salt.modules.inspectlib.entities.PackageCfgFile Config file, belongs to the package
class salt.modules.inspectlib.entities.PayloadFile Payload file.
salt.modules.inspectlib.fsdb codeauthor Bo Maryniuk <bo@suse.de>
class salt.modules.inspectlib.fsdb.CsvDB(path) File-based CSV database.  This database is in-memory operating relatively small plain text csv files.
close() Close the database.
create_table_from_object(obj) Create a table from the object.  NOTE: This method doesn't stores anything.
Parameters obj --
delete(obj, matches=None, mt=None, lt=None, eq=None) Delete object from the database.
• obj --
• matches --
• mt --
• lt --
• eq --
flush(table) Flush table.
Parameters table --
get(obj, matches=None, mt=None, lt=None, eq=None) Get objects from the table.
• table_name --
• matches -- Regexp.
• mt -- More than.
• lt -- Less than.
• eq -- Equals.
is_closed() Return if the database is closed.
list() List all the databases on the given path.
list_tables() Load existing tables and their descriptions.
new()  Create a new database and opens it.
open(dbname=None) Open database from the path with the name or latest.  If there are no yet databases, create a new implicitly.
purge(dbid) Purge the database.
Parameters dbid --
store(obj, distinct=False) Store an object in the table.
• obj -- An object to store
• distinct -- Store object only if there is none identical of such.  If at least one field is different, store it.
update(obj, matches=None, mt=None, lt=None, eq=None) Update object(s) in the database.
class salt.modules.inspectlib.fsdb.CsvDBEntity Serializable object for the table.
salt.modules.inspectlib.kiwiproc class salt.modules.inspectlib.kiwiproc.KiwiExporter(grains, format) Exports system description as Kiwi configuration.
export(name) Export to the Kiwi config.xml as text.
load(**descr) Load data by keys.
Parameters data --
salt.modules.inspector Module for full system inspection.
salt.modules.inspector.build(format='qcow2', path='/tmp/') Build an image from a current system description.  The image is a system image can be output in bootable ISO or QCOW2 formats.
Node uses the image building library Kiwi to perform the actual build.
• format: Specifies output format: "qcow2" or "iso. Default: qcow2.
• path: Specifies output path where to store built image. Default: /tmp.
salt myminion inspector.build salt myminion inspector.build format=iso path=/opt/builds/
salt.modules.inspector.delete(all=False, *databases) Remove description snapshots from the system.
::parameter: all. Default: False. Remove all snapshots, if set to True.
salt myminion inspector.delete <ID> <ID1> <ID2>.. salt myminion inspector.delete all=True
salt.modules.inspector.export(local=False, path='/tmp', format='qcow2') Export an image description for Kiwi.
• local: Specifies True or False if the export has to be in the local file. Default: False.
path: If local=True, then specifies the path where file with the Kiwi description is written. Default: /tmp.
salt myminion inspector.export salt myminion inspector.export format=iso path=/opt/builds/
salt.modules.inspector.inspect(mode='all', priority=19, **kwargs) Start node inspection and save the data to the database for further query.
• mode: Clarify inspection mode: configuration, payload, all (default)
• filter: Comma-separated directories to track payload.
• priority: (advanced) Set priority of the inspection. Default is low priority.
salt '*' inspector.inspect salt '*' inspector.inspect configuration salt '*' inspector.inspect payload filter=/opt,/ext/oracle
salt.modules.inspector.query(*args, **kwargs) Query the node for specific information.
• scope: Specify scope of the query.
• System: Return system data.
• Software: Return software information.
• Services: Return known services.
Identity: Return user accounts information for this system.
accounts Can be either 'local', 'remote' or 'all' (equal to "local,remote").  Remote accounts cannot be resolved on all systems, but only those, which supports 'passwd -S -a'.
disabled True (or False, default) to return only disabled accounts.
payload: Payload scope parameters:
filter Include only results which path starts from the filter string.
time   Display time in Unix ticks or format according to the configured TZ (default) Values: ticks, tz (default)
size   Format size. Values: B, KB, MB, GB
type   Include payload type.  Values (comma-separated): directory (or dir), link, file (default) Example (returns everything): type=directory,link,file
owners Resolve UID/GID to an actual names or leave them numeric (default).  Values: name (default), id
brief  Return just a list of payload elements, if True. Default: False.
• all: Return all information (default).
salt '*' inspector.query scope=system salt '*' inspector.query scope=payload type=file,link filter=/etc size=Kb brief=False
salt.modules.inspector.snapshots() List current description snapshots.
salt myminion inspector.snapshots
salt.modules.introspect Functions to perform introspection on a minion, and return data in a format usable by Salt States
salt.modules.introspect.enabled_service_owners() Return which packages own each of the services that are currently enabled.
salt myminion introspect.enabled_service_owners
salt.modules.introspect.running_service_owners(exclude=('/dev', '/home', '/media', '/proc', '/run', '/sys/', '/tmp', '/var')) Determine which packages own the currently running services. By default, excludes files whose full path starts with /dev, /home, /media, /proc, /run, /sys, /tmp and /var. This can be overridden by passing in a new list to exclude.
salt myminion introspect.running_service_owners
salt.modules.introspect.service_highstate(requires=True) Return running and enabled services in a highstate structure. By default also returns package dependencies for those services, which means that package definitions must be created outside this function. To drop the package dependencies, set requires to False.
salt myminion introspect.service_highstate salt myminion introspect.service_highstate requires=False
salt.modules.iosconfig Cisco IOS configuration manipulation helpers
This module provides a collection of helper functions for Cisco IOS style configuration manipulation. This module does not have external dependencies and can be used from any Proxy or regular Minion.
salt.modules.iosconfig.clean(config=None, path=None, saltenv='base') Return a clean version of the config, without any special signs (such as ! as an individual line) or empty lines, but just lines with significant value in the configuration of the network device.
config The configuration sent as text. This argument is ignored when path is configured.
path   Absolute or remote path from where to load the configuration text. This argument allows any URI supported by cp.get_url), e.g., salt://, https://, s3://, ftp:/, etc.
saltenv: base Salt fileserver environment from which to retrieve the file.  Ignored if path is not a salt:// URL.
salt '*' iosconfig.clean path=salt://path/to/my/config.txt salt '*' iosconfig.clean path=https://bit.ly/2mAdq7z
salt.modules.iosconfig.diff_text(candidate_config=None, candidate_path=None, running_config=None, running_path=None, saltenv='base') Return the diff, as text, between the candidate and the running config.
candidate_config The candidate configuration sent as text. This argument is ignored when candidate_path is set.
candidate_path Absolute or remote path from where to load the candidate configuration text. This argument allows any URI supported by cp.get_url), e.g., salt://, https://, s3://, ftp:/, etc.
running_config The running configuration sent as text. This argument is ignored when running_path is set.
running_path Absolute or remote path from where to load the running configuration text. This argument allows any URI supported by cp.get_url), e.g., salt://, https://, s3://, ftp:/, etc.
saltenv: base Salt fileserver environment from which to retrieve the file.  Ignored if candidate_path or running_path is not a salt:// URL.
salt '*' iosconfig.diff_text candidate_path=salt://path/to/candidate.cfg running_path=salt://path/to/running.cfg
salt.modules.iosconfig.diff_tree(candidate_config=None, candidate_path=None, running_config=None, running_path=None, saltenv='base') Return the diff, as Python dictionary, between the candidate and the running configuration.
salt '*' iosconfig.diff_tree candidate_path=salt://path/to/candidate.cfg running_path=salt://path/to/running.cfg
salt.modules.iosconfig.merge_diff(initial_config=None, initial_path=None, merge_config=None, merge_path=None, saltenv='base') Return the merge diff, as text, after merging the merge config into the initial config.
initial_config The initial configuration sent as text. This argument is ignored when initial_path is set.
initial_path Absolute or remote path from where to load the initial configuration text. This argument allows any URI supported by cp.get_url), e.g., salt://, https://, s3://, ftp:/, etc.
merge_config The config to be merged into the initial config, sent as text. This argument is ignored when merge_path is set.
merge_path Absolute or remote path from where to load the merge configuration text. This argument allows any URI supported by cp.get_url), e.g., salt://, https://, s3://, ftp:/, etc.
saltenv: base Salt fileserver environment from which to retrieve the file.  Ignored if initial_path or merge_path is not a salt:// URL.
salt '*' iosconfig.merge_diff initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg
salt.modules.iosconfig.merge_text(initial_config=None, initial_path=None, merge_config=None, merge_path=None, saltenv='base') Return the merge result of the initial_config with the merge_config, as plain text.
salt '*' iosconfig.merge_text initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg
salt.modules.iosconfig.merge_tree(initial_config=None, initial_path=None, merge_config=None, merge_path=None, saltenv='base') Return the merge tree of the initial_config with the merge_config, as a Python dictionary.
salt '*' iosconfig.merge_tree initial_path=salt://path/to/running.cfg merge_path=salt://path/to/merge.cfg
salt.modules.iosconfig.tree(config=None, path=None, with_tags=False, saltenv='base') Transform Cisco IOS style configuration to structured Python dictionary.  Depending on the value of the with_tags argument, this function may provide different views, valuable in different situations.
with_tags: False Whether this function should return a detailed view, with tags.
salt '*' iosconfig.tree path=salt://path/to/my/config.txt salt '*' iosconfig.tree path=https://bit.ly/2mAdq7z
salt.modules.ipmi Support IPMI commands over LAN. This module does not talk to the local systems hardware through IPMI drivers. It uses a python module pyghmi.
depends Python module pyghmi.  You can install pyghmi using pip:
pip install pyghmi
configuration The following configuration defaults can be define (pillar or config files):
ipmi.config: api_host: 127.0.0.1 api_user: admin api_pass: apassword api_port: 623 api_kg: None
Usage can override the config defaults:
salt-call ipmi.get_user api_host=myipmienabled.system api_user=admin api_pass=pass uid=1
salt.modules.ipmi.create_user(uid, name, password, channel=14, callback=False, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs) create/ensure a user is created with provided settings.
• privilege_level -- User Privilege Limit. (Determines the maximum privilege level that the user is allowed to switch to on the specified channel.)  * callback * user * operator * administrator * proprietary * no_access
• kwargs -- .INDENT 2.0
• api_host=127.0.0.1
• api_user=admin
• api_pass=example
• api_port=623
• api_kg=None
salt-call ipmi.create_user uid=2 name=steverweber api_host=172.168.0.7 api_pass=nevertell
salt.modules.ipmi.fast_connect_test(**kwargs) Returns True if connection success.  This uses an aggressive timeout value!
Parameters kwargs -- .INDENT 7.0
salt-call ipmi.fast_connect_test api_host=172.168.0.9
salt.modules.ipmi.get_bootdev(**kwargs) Get current boot device override information.
Provides the current requested boot device.  Be aware that not all IPMI devices support this.  Even in BMCs that claim to, occasionally the BIOS or UEFI fail to honor it. This is usually only applicable to the next reboot.
salt-call ipmi.get_bootdev api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.get_channel_access(channel=14, read_mode='non_volatile', **kwargs) :param kwargs:api_host='127.0.0.1' api_user='admin' api_pass='example' api_port=623
• channel -- number [1:7]
• read_mode -- .INDENT 2.0
• non_volatile  = get non-volatile Channel Access
• volatile      = get present volatile (active) setting of Channel Access
Return Data A Python dict with the following keys/values:
{ alerting: per_msg_auth: user_level_auth: access_mode:{ (ONE OF) 0: 'disabled', 1: 'pre_boot', 2: 'always', 3: 'shared' } privilege_level: { (ONE OF) 1: 'callback', 2: 'user', 3: 'operator', 4: 'administrator', 5: 'proprietary', } }
salt-call ipmi.get_channel_access channel=1
salt.modules.ipmi.get_channel_info(channel=14, **kwargs) Get channel info
Return Data channel session supports
- no_session: channel is session-less - single: channel is single-session - multi: channel is multi-session - auto: channel is session-based (channel could alternate between single- and multi-session operation, as can occur with a serial/modem channel that supports connection mode auto-detect)
salt-call ipmi.get_channel_info
salt.modules.ipmi.get_channel_max_user_count(channel=14, **kwargs) Get max users in channel
Returns int -- often 16
salt-call ipmi.get_channel_max_user_count
salt.modules.ipmi.get_health(**kwargs) Get Summarize health
This provides a summary of the health of the managed system.  It additionally provides an iterable list of reasons for warning, critical, or failed assessments.
good health: {'badreadings': [], 'health': 0}
salt-call ipmi.get_health api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.get_power(**kwargs) Get current power state
The response, if successful, should contain 'powerstate' key and either 'on' or 'off' to indicate current state.
salt-call ipmi.get_power api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.get_sensor_data(**kwargs) Get sensor readings
Iterates sensor reading objects
salt-call ipmi.get_sensor_data api_host=127.0.0.1 api_user=admin api_pass=pass
salt.modules.ipmi.get_user(uid, channel=14, **kwargs) Get user from uid and access on channel
• uid -- user number [1:16]
Return Data
name: (str) uid: (int) channel: (int) access: - callback (bool) - link_auth (bool) - ipmi_msg (bool) - privilege_level: (str)[callback, user, operatorm administrator, proprietary, no_access]
salt-call ipmi.get_user uid=2
salt.modules.ipmi.get_user_access(uid, channel=14, **kwargs) Get user access
channel_info: - max_user_count = maximum number of user IDs on this channel - enabled_users = count of User ID slots presently in use - users_with_fixed_names = count of user IDs with fixed names access: - callback - link_auth - ipmi_msg - privilege_level: [reserved, callback, user, operator administrator, proprietary, no_access]
salt-call ipmi.get_user_access uid=2
salt.modules.ipmi.get_user_name(uid, return_none_on_error=True, **kwargs) Get user name
• return_none_on_error -- return None on error
salt-call ipmi.get_user_name uid=2
salt.modules.ipmi.get_users(channel=14, **kwargs) get list of users and access information
• name: (str)
• uid: (int)
• channel: (int)
access:
• callback (bool)
• link_auth (bool)
• ipmi_msg (bool)
• privilege_level: (str)[callback, user, operatorm administrator, proprietary, no_access]
salt-call ipmi.get_users api_host=172.168.0.7
salt.modules.ipmi.raw_command(netfn, command, bridge_request=None, data=(), retry=True, delay_xmit=None, **kwargs) Send raw ipmi command
This allows arbitrary IPMI bytes to be issued.  This is commonly used for certain vendor specific commands.
• netfn -- Net function number
• command -- Command value
• bridge_request -- The target slave address and channel number for the bridge request.
• data -- Command data as a tuple or list
Returns dict -- The response from IPMI device
salt-call ipmi.raw_command netfn=0x06 command=0x46 data=[0x02] # this will return the name of the user with id 2 in bytes
salt.modules.ipmi.set_bootdev(bootdev='default', persist=False, uefiboot=False, **kwargs) Set boot device to use on next reboot
• bootdev -- .INDENT 2.0
• network: Request network boot
• hd: Boot from hard drive
• safe: Boot from hard drive, requesting 'safe mode'
• optical: boot from CD/DVD/BD drive
• setup: Boot into setup utility
• default: remove any IPMI directed boot device request
• persist -- If true, ask that system firmware use this device beyond next boot.  Be aware many systems do not honor this
• uefiboot -- If true, request UEFI boot explicitly.  Strictly speaking, the spec suggests that if not set, the system should BIOS boot and offers no "don't care" option.  In practice, this flag not being set does not preclude UEFI boot on any system I've encountered.
Returns dict or True -- If callback is not provided, the response
salt-call ipmi.set_bootdev bootdev=network persist=True
salt.modules.ipmi.set_channel_access(channel=14, access_update_mode='non_volatile', alerting=False, per_msg_auth=False, user_level_auth=False, access_mode='always', privilege_update_mode='non_volatile', privilege_level='administrator', **kwargs) Set channel access
• access_update_mode -- .INDENT 2.0
• 'dont_change'  = don't set or change Channel Access
• 'non_volatile' = set non-volatile Channel Access
• 'volatile'     = set volatile (active) setting of Channel Access
• alerting --
PEF Alerting Enable/Disable
• True  = enable PEF Alerting
• False = disable PEF Alerting on this channel (Alert Immediate command can still be used to generate alerts)
• per_msg_auth --
Per-message Authentication
• True  = enable
• False = disable Per-message Authentication. [Authentication required to activate any session on this channel, but authentication not used on subsequent packets for the session.]
• user_level_auth --
User Level Authentication Enable/Disable
• True  = enable User Level Authentication. All User Level commands are to be authenticated per the Authentication Type that was negotiated when the session was activated.
• False = disable User Level Authentication. Allow User Level commands to be executed without being authenticated.  If the option to disable User Level Command authentication is accepted, the BMC will accept packets with Authentication Type set to None if they contain user level commands.  For outgoing packets, the BMC returns responses with the same Authentication Type that was used for the request.
• access_mode --
Access Mode for IPMI messaging (PEF Alerting is enabled/disabled separately from IPMI messaging)
• disabled = disabled for IPMI messaging
• pre_boot = pre-boot only channel only available when system is in a powered down state or in BIOS prior to start of boot.
• always   = channel always available regardless of system mode. BIOS typically dedicates the serial connection to the BMC.
• shared   = same as always available, but BIOS typically leaves the serial port available for software use.
• privilege_update_mode --
Channel Privilege Level Limit. This value sets the maximum privilege level that can be accepted on the specified channel.
• dont_change  = don't set or change channel Privilege Level Limit
• non_volatile = non-volatile Privilege Level Limit according
• volatile     = volatile setting of Privilege Level Limit
• privilege_level --
Channel Privilege Level Limit
• reserved      = unused
• callback
• operator
• administrator
• proprietary   = used by OEM
salt-call ipmi.set_channel_access privilege_level='administrator'
salt.modules.ipmi.set_identify(on=True, duration=600, **kwargs) Request identify light
Request the identify light to turn off, on for a duration, or on indefinitely.  Other than error exceptions,
• on -- Set to True to force on or False to force off
• duration -- Set if wanting to request turn on for a duration in seconds, None = indefinitely.
salt-call ipmi.set_identify
salt.modules.ipmi.set_power(state='power_on', wait=True, **kwargs) Request power state change
• name -- .INDENT 2.0
• power_on -- system turn on
• power_off -- system turn off (without waiting for OS)
• shutdown -- request OS proper shutdown
• reset -- reset (without waiting for OS)
• boot -- If system is off, then 'on', else 'reset'
• ensure -- If (bool True), do not return until system actually completes requested state change for 300 seconds.  If a non-zero (int), adjust the wait time to the requested number of seconds
Returns dict -- A dict describing the response retrieved
salt-call ipmi.set_power state=shutdown wait=True
salt.modules.ipmi.set_user_access(uid, channel=14, callback=True, link_auth=True, ipmi_msg=True, privilege_level='administrator', **kwargs) Set user access
• callback --
User Restricted to Callback
• False = User Privilege Limit is determined by the User Privilege Limit parameter, below, for both callback and non-callback connections.
• True  = User Privilege Limit is determined by the User Privilege Limit parameter for callback connections, but is restricted to Callback level for non-callback connections. Thus, a user can only initiate a Callback when they 'call in' to the BMC, but once the callback connection has been made, the user could potentially establish a session as an Operator.
• link_auth -- User Link authentication enable/disable (used to enable whether this user's name and password information will be used for link authentication, e.g. PPP CHAP) for the given channel. Link authentication itself is a global setting for the channel and is enabled/disabled via the serial/modem configuration parameters.
• ipmi_msg -- User IPMI Messaging: (used to enable/disable whether this user's name and password information will be used for IPMI Messaging. In this case, 'IPMI Messaging' refers to the ability to execute generic IPMI commands that are not associated with a particular payload type. For example, if IPMI Messaging is disabled for a user, but that user is enabled for activating the SOL payload type, then IPMI commands associated with SOL and session management, such as Get SOL Configuration Parameters and Close Session are available, but generic IPMI commands such as Get SEL Time are unavailable.)
User Privilege Limit. (Determines the maximum privilege level that the user is allowed to switch to on the specified channel.)
• proprietary
• no_access
salt-call ipmi.set_user_access uid=2 privilege_level='operator'
salt.modules.ipmi.set_user_name(uid, name, **kwargs) Set user name
• name -- username (limit of 16bytes)
salt-call ipmi.set_user_name uid=2 name='steverweber'
salt.modules.ipmi.set_user_password(uid, mode='set_password', password=None, **kwargs) Set user password and (modes)
• uid -- id number of user.  see: get_names_uid()['name']
• mode -- .INDENT 2.0
• disable       = disable user connections
• enable        = enable user connections
• set_password  = set or ensure password
• test_password = test password is correct
• password -- max 16 char string (optional when mode is [disable or enable])
Returns True on success when mode = test_password, return False on bad password
salt-call ipmi.set_user_password api_host=127.0.0.1 api_user=admin api_pass=pass uid=1 password=newPass salt-call ipmi.set_user_password uid=1 mode=enable
salt.modules.ipmi.user_delete(uid, channel=14, **kwargs) Delete user (helper)
salt-call ipmi.user_delete uid=2
salt.modules.ipset Support for ipset
salt.modules.ipset.add(name=None, entry=None, family='ipv4', **kwargs) Append an entry to the specified set.
salt '*' ipset.add name 192.168.1.26
salt '*' ipset.add name 192.168.0.3,AA:BB:CC:DD:EE:FF
salt.modules.ipset.check(name=None, entry=None, family='ipv4') Check that an entry exists in the specified set.
name   The ipset name
entry  An entry in the ipset.  This parameter can be a single IP address, a range of IP addresses, or a subnet block. Example:
192.168.0.1 192.168.0.2-192.168.0.19 192.168.0.0/25
family IP protocol version: ipv4 or ipv6
salt '*' ipset.check name '192.168.0.1 comment "Hello"'
salt.modules.ipset.check_set(name=None, family='ipv4') Check that given ipset set exists.
salt '*' ipset.check_set name
salt.modules.ipset.delete(name=None, entry=None, family='ipv4', **kwargs) Delete an entry from the specified set.
salt '*' ipset.delete name 192.168.0.3,AA:BB:CC:DD:EE:FF
salt.modules.ipset.delete_set(name=None, family='ipv4') New in version 2014.7.0.
Delete ipset set.
salt '*' ipset.delete_set custom_set
IPv6: salt '*' ipset.delete_set custom_set family=ipv6
salt.modules.ipset.flush(name=None, family='ipv4') Flush entries in the specified set, Flush all sets if set is not specified.
salt '*' ipset.flush
salt '*' ipset.flush set
IPv6: salt '*' ipset.flush
salt.modules.ipset.list_sets(family='ipv4') New in version 2014.7.0.
List all ipset sets.
salt '*' ipset.list_sets
salt.modules.ipset.new_set(name=None, set_type=None, family='ipv4', comment=False, **kwargs) New in version 2014.7.0.
Create new custom set
salt '*' ipset.new_set custom_set list:set
salt '*' ipset.new_set custom_set list:set comment=True
IPv6: salt '*' ipset.new_set custom_set list:set family=ipv6
salt.modules.ipset.rename_set(name=None, new_set=None, family='ipv4') New in version 2014.7.0.
salt '*' ipset.rename_set custom_set new_set=new_set_name
IPv6: salt '*' ipset.rename_set custom_set new_set=new_set_name family=ipv6
salt.modules.ipset.test(name=None, entry=None, family='ipv4', **kwargs) Test if an entry is in the specified set.
salt '*' ipset.test name 192.168.0.2
IPv6: salt '*' ipset.test name fd81:fc56:9ac7::/48
salt.modules.ipset.version() Return version from ipset --version
salt '*' ipset.version
salt.modules.iptables Support for iptables
Configuration Options The following options can be set in the minion config, grains, pillar, or master config. The configuration is read using config.get.
• iptables.save_filters: List of REGEX strings to FILTER OUT matching lines
This is useful for filtering out chains, rules, etc that you do not wish to persist, such as ephemeral Docker rules.
The default is to not filter out anything.
iptables.save_filters: - "-j CATTLE_PREROUTING" - "-j DOCKER" - "-A POSTROUTING" - "-A CATTLE_POSTROUTING" - "-A FORWARD"
salt.modules.iptables.append(table='filter', chain=None, rule=None, family='ipv4') Append a rule to the specified table/chain.
This function accepts a rule in a standard iptables command format, starting with the chain. Trying to force users to adapt to a new method of creating rules would be irritating at best, and we already have a parser that can handle it.
salt '*' iptables.append filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'
IPv6: salt '*' iptables.append filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \ family=ipv6
salt.modules.iptables.build_rule(table='filter', chain=None, command=None, position='', full=None, family='ipv4', **kwargs) Build a well-formatted iptables rule based on kwargs. A table and chain are not required, unless full is True.
If full is True, then table, chain and command are required. command may be specified as either a short option ('I') or a long option (--insert). This will return the iptables command, exactly as it would be used from the command line.
If a position is required (as with -I or -D), it may be specified as position. This will only be useful if full is True.
If state is passed, it will be ignored, use connstate.  If connstate is passed in, it will automatically be changed to state.
To pass in jump options that doesn't take arguments, pass in an empty string.
NOTE: Whereas iptables will accept -p, --proto[c[o[l]]] as synonyms of --protocol, if --proto appears in an iptables command after the appearance of -m policy, it is interpreted as the --proto option of the policy extension (see the iptables-extensions(8) man page).
salt '*' iptables.build_rule match=state \ connstate=RELATED,ESTABLISHED jump=ACCEPT
salt '*' iptables.build_rule filter INPUT command=I position=3 \ full=True match=state connstate=RELATED,ESTABLISHED jump=ACCEPT
salt '*' iptables.build_rule filter INPUT command=A \ full=True match=state connstate=RELATED,ESTABLISHED \ source='127.0.0.1' jump=ACCEPT
.. Invert Rules salt '*' iptables.build_rule filter INPUT command=A \ full=True match=state connstate=RELATED,ESTABLISHED \ source='!127.0.0.1' jump=ACCEPT
salt '*' iptables.build_rule filter INPUT command=A \ full=True match=state connstate=RELATED,ESTABLISHED \ destination='not 127.0.0.1' jump=ACCEPT
IPv6: salt '*' iptables.build_rule match=state \ connstate=RELATED,ESTABLISHED jump=ACCEPT \ family=ipv6 salt '*' iptables.build_rule filter INPUT command=I position=3 \ full=True match=state connstate=RELATED,ESTABLISHED jump=ACCEPT \ family=ipv6
salt.modules.iptables.check(table='filter', chain=None, rule=None, family='ipv4') Check for the existence of a rule in the table and chain
salt '*' iptables.check filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'
IPv6: salt '*' iptables.check filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \ family=ipv6
salt.modules.iptables.check_chain(table='filter', chain=None, family='ipv4') New in version 2014.1.0.
Check for the existence of a chain in the table
salt '*' iptables.check_chain filter INPUT
IPv6: salt '*' iptables.check_chain filter INPUT family=ipv6
salt.modules.iptables.delete(table, chain=None, position=None, rule=None, family='ipv4')
Delete a rule from the specified table/chain, specifying either the rule in its entirety, or the rule's position in the chain.
salt '*' iptables.delete filter INPUT position=3 salt '*' iptables.delete filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'
IPv6: salt '*' iptables.delete filter INPUT position=3 family=ipv6 salt '*' iptables.delete filter INPUT \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \ family=ipv6
salt.modules.iptables.delete_chain(table='filter', chain=None, family='ipv4') New in version 2014.1.0.
Delete custom chain to the specified table.
salt '*' iptables.delete_chain filter CUSTOM_CHAIN
IPv6: salt '*' iptables.delete_chain filter CUSTOM_CHAIN family=ipv6
salt.modules.iptables.flush(table='filter', chain='', family='ipv4') Flush the chain in the specified table, flush all chains in the specified table if not specified chain.
salt '*' iptables.flush filter INPUT
IPv6: salt '*' iptables.flush filter INPUT family=ipv6
salt.modules.iptables.get_policy(table='filter', chain=None, family='ipv4') Return the current policy for the specified table/chain
salt '*' iptables.get_policy filter INPUT
IPv6: salt '*' iptables.get_policy filter INPUT family=ipv6
salt.modules.iptables.get_rules(family='ipv4') Return a data structure of the current, in-memory rules
salt '*' iptables.get_rules
IPv6: salt '*' iptables.get_rules family=ipv6
salt.modules.iptables.get_saved_policy(table='filter', chain=None, conf_file=None, family='ipv4') Return the current policy for the specified table/chain
salt '*' iptables.get_saved_policy filter INPUT salt '*' iptables.get_saved_policy filter INPUT \ conf_file=/etc/iptables.saved
IPv6: salt '*' iptables.get_saved_policy filter INPUT family=ipv6 salt '*' iptables.get_saved_policy filter INPUT \ conf_file=/etc/iptables.saved family=ipv6
salt.modules.iptables.get_saved_rules(conf_file=None, family='ipv4') Return a data structure of the rules in the conf file
salt '*' iptables.get_saved_rules
IPv6: salt '*' iptables.get_saved_rules family=ipv6
salt.modules.iptables.insert(table='filter', chain=None, position=None, rule=None, family='ipv4') Insert a rule into the specified table/chain, at the specified position.
If the position specified is a negative number, then the insert will be performed counting from the end of the list. For instance, a position of -1 will insert the rule as the second to last rule. To insert a rule in the last position, use the append function instead.
salt '*' iptables.insert filter INPUT position=3 \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT'
IPv6: salt '*' iptables.insert filter INPUT position=3 \ rule='-m state --state RELATED,ESTABLISHED -j ACCEPT' \ family=ipv6
salt.modules.iptables.new_chain(table='filter', chain=None, family='ipv4') New in version 2014.1.0.
Create new custom chain to the specified table.
salt '*' iptables.new_chain filter CUSTOM_CHAIN
IPv6: salt '*' iptables.new_chain filter CUSTOM_CHAIN family=ipv6
salt.modules.iptables.save(filename=None, family='ipv4') Save the current in-memory rules to disk
salt '*' iptables.save /etc/sysconfig/iptables
IPv6: salt '*' iptables.save /etc/sysconfig/iptables family=ipv6
salt.modules.iptables.set_policy(table='filter', chain=None, policy=None, family='ipv4') Set the current policy for the specified table/chain
salt '*' iptables.set_policy filter INPUT ACCEPT
IPv6: salt '*' iptables.set_policy filter INPUT ACCEPT family=ipv6
salt.modules.iptables.version(family='ipv4') Return version from iptables --version
salt '*' iptables.version
IPv6: salt '*' iptables.version family=ipv6
salt.modules.iwtools Support for Wireless Tools for Linux
salt.modules.iwtools.list_interfaces(style=None) List all of the wireless interfaces
salt minion iwtools.list_interfaces
salt.modules.iwtools.scan(iface, style=None) List networks on a wireless interface
salt minion iwtools.scan wlp3s0 salt minion iwtools.scan wlp3s0 list
salt.modules.iwtools.set_mode(iface, mode) List networks on a wireless interface
salt minion iwtools.set_mode wlp3s0 Managed
salt.modules.jboss7 Module for managing JBoss AS 7 through the CLI interface.
In order to run each function, jboss_config dictionary with the following properties must be passed:
• cli_path: the path to jboss-cli script, for example: '/opt/jboss/jboss-7.0/bin/jboss-cli.sh'
• controller: the IP address and port of controller, for example: 10.11.12.13:9999
• cli_user: username to connect to jboss administration console if necessary
• cli_password: password to connect to jboss administration console if necessary
jboss_config: cli_path: '/opt/jboss/jboss-7.0/bin/jboss-cli.sh' controller: 10.11.12.13:9999 cli_user: 'jbossadm' cli_password: 'jbossadm'
salt.modules.jboss7.create_datasource(jboss_config, name, datasource_properties, profile=None) Create datasource in running jboss instance
jboss_config Configuration dictionary with properties specified above.
name   Datasource name
datasource_properties
A dictionary of datasource properties to be created:
• driver-name: mysql
• connection-url: '‐ jdbc:mysql://localhost:3306/sampleDatabase'
• jndi-name: 'java:jboss/datasources/sampleDS'
• user-name: sampleuser
• password: secret
• min-pool-size: 3
• use-java-context: True
profile The profile name (JBoss domain mode only)
salt '*' jboss7.create_datasource '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' 'my_datasource' '{"driver-name": "mysql", "connection-url": "jdbc:mysql://localhost:3306/sampleDatabase", "jndi-name": "java:jboss/datasources/sampleDS", "user-name": "sampleuser", "password": "secret", "min-pool-size": 3, "use-java-context": True}'
salt.modules.jboss7.create_simple_binding(jboss_config, binding_name, value, profile=None) Create a simple jndi binding in the running jboss instance
binding_name Binding name to be created
value  Binding value
salt '*' jboss7.create_simple_binding \ '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", \ "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' \ my_binding_name my_binding_value
salt.modules.jboss7.deploy(jboss_config, source_file) Deploy the application on the jboss instance from the local file system where minion is running.
source_file Source file to deploy from
salt '*' jboss7.deploy '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' /opt/deploy_files/my_deploy
salt.modules.jboss7.list_deployments(jboss_config) List all deployments on the jboss instance
salt '*' jboss7.list_deployments '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}'
salt.modules.jboss7.read_datasource(jboss_config, name, profile=None) Read datasource properties in the running jboss instance.
profile Profile name (JBoss domain mode only)
salt '*' jboss7.read_datasource '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}'
salt.modules.jboss7.read_simple_binding(jboss_config, binding_name, profile=None) Read jndi binding in the running jboss instance
salt '*' jboss7.read_simple_binding '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_binding_name
salt.modules.jboss7.reload_(jboss_config, host=None) Reload running jboss instance
host   The name of the host. JBoss domain mode only - and required if running in domain mode.  The host name is the "name" attribute of the "host" element in host.xml
salt '*' jboss7.reload '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}'
salt.modules.jboss7.remove_datasource(jboss_config, name, profile=None) Remove an existing datasource from the running jboss instance.
profile The profile (JBoss domain mode only)
salt '*' jboss7.remove_datasource '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_datasource_name
salt.modules.jboss7.status(jboss_config, host=None, server_config=None) Get status of running jboss instance.
server_config The name of the Server Configuration. JBoss Domain mode only - and required if running in domain mode.
salt '*' jboss7.status '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}'
salt.modules.jboss7.stop_server(jboss_config, host=None) Stop running jboss instance
salt '*' jboss7.stop_server '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}'
salt.modules.jboss7.undeploy(jboss_config, deployment) Undeploy the application from jboss instance
deployment Deployment name to undeploy
salt '*' jboss7.undeploy '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_deployment
salt.modules.jboss7.update_datasource(jboss_config, name, new_properties, profile=None) Update an existing datasource in running jboss instance.  If the property doesn't exist if will be created, if it does, it will be updated with the new value
new_properties
A dictionary of datasource properties to be updated. For example:
salt '*' jboss7.update_datasource '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' 'my_datasource' '{"driver-name": "mysql", "connection-url": "jdbc:mysql://localhost:3306/sampleDatabase", "jndi-name": "java:jboss/datasources/sampleDS", "user-name": "sampleuser", "password": "secret", "min-pool-size": 3, "use-java-context": True}'
salt.modules.jboss7.update_simple_binding(jboss_config, binding_name, value, profile=None) Update the simple jndi binding in the running jboss instance
binding_name Binding name to be updated
value  New binding value
salt '*' jboss7.update_simple_binding '{"cli_path": "integration.modules.sysmod.SysModuleTest.test_valid_docs", "controller": "10.11.12.13:9999", "cli_user": "jbossadm", "cli_password": "jbossadm"}' my_binding_name my_binding_value
salt.modules.jboss7_cli Module for low-level interaction with JbossAS7 through CLI.
This module exposes two ways of interaction with the CLI, either through commands or operations.
NOTE: Following JBoss documentation (‐ https://developer.jboss.org/wiki/CommandLineInterface): "Operations are considered a low level but comprehensive way to manage the AS controller, i.e. if it can't be done with operations it can't be done in any other way.  Commands, on the other hand, are more user-friendly in syntax, although most of them still translate into operation requests and some of them even into a few composite operation requests, i.e. commands also simplify some management operations from the user's point of view."
The difference between calling a command or operation is in handling the result.  Commands return a zero return code if operation is successful or return non-zero return code and print an error to standard output in plain text, in case of an error.
Operations return a json-like structure, that contain more information about the result.  In case of a failure, they also return a specific return code. This module parses the output from the operations and returns it as a dictionary so that an execution of an operation can then be verified against specific errors.
salt.modules.jboss7_cli.run_command(jboss_config, command, fail_on_error=True) Execute a command against jboss instance through the CLI interface.
command Command to execute against jboss instance
fail_on_error (default=True) Is true, raise CommandExecutionError exception if execution fails.  If false, 'success' property of the returned dictionary is set to False