neulab/tldr huggingface dataset:
salt.modules.state.top(topfn, test=None, queue=False, **kwargs) Execute a specific top file instead of the default. This is useful to apply configurations from a different environment (for example, dev or prod), without modifying the default top file.
salt '*' state.top reverse_top.sls salt '*' state.top prod_top.sls exclude=sls_to_exclude salt '*' state.top dev_top.sls exclude="[{'id': 'id_to_exclude'}, {'sls': 'sls_to_exclude'}]"
salt.modules.status Module for returning various status data about a minion.  These data can be useful for compiling into stats later.
salt.modules.status.all_status() Return a composite of all status data and info for this minion. Warning: There is a LOT here!
salt '*' status.all_status
salt.modules.status.cpuinfo() Changed in version 2016.3.2: Return the CPU info for this minion
Changed in version 2018.3.0: Added support for NetBSD and OpenBSD
salt '*' status.cpuinfo
salt.modules.status.cpustats() Return the CPU stats for this minion
Changed in version 2018.3.0: Added support for OpenBSD
salt '*' status.cpustats
salt.modules.status.custom() Return a custom composite of status data and info for this minion, based on the minion config file. An example config like might be:
status.cpustats.custom: [ 'cpu', 'ctxt', 'btime', 'processes' ]
Where status refers to status.py, cpustats is the function where we get our data, and custom is this function It is followed by a list of keys that we want returned.
This function is meant to replace all_status(), which returns anything and everything, which we probably don't want.
By default, nothing is returned. Warning: Depending on what you include, there can be a LOT here!
salt '*' status.custom
salt.modules.status.diskstats() Changed in version 2016.3.2: Return the disk stats for this minion
salt '*' status.diskstats
salt.modules.status.diskusage(*args) Return the disk usage for this minion
salt '*' status.diskusage [paths and/or filesystem types]
salt '*' status.diskusage         # usage for all filesystems salt '*' status.diskusage / /tmp  # usage for / and /tmp salt '*' status.diskusage ext?    # usage for ext[234] filesystems salt '*' status.diskusage / ext?  # usage for / and all ext filesystems
salt.modules.status.loadavg() Return the load averages for this minion
salt '*' status.loadavg
:raises CommandExecutionError: If the system cannot report loadaverages to Python
salt.modules.status.master(master=None, connected=True) New in version 2014.7.0.
Return the connection status with master. Fire an event if the connection to master is not as expected. This function is meant to be run via a scheduled job from the minion. If master_ip is an FQDN/Hostname, it must be resolvable to a valid IPv4 address.
salt '*' status.master
salt.modules.status.meminfo() Return the memory info for this minion
salt '*' status.meminfo
salt.modules.status.netdev() Changed in version 2016.3.2: Return the network device stats for this minion
salt '*' status.netdev
salt.modules.status.netstats() Return the network stats for this minion
salt '*' status.netstats
salt.modules.status.nproc() Return the number of processing units available on this system
Changed in version 2018.3.0: Added support for Darwin, FreeBSD and OpenBSD
salt '*' status.nproc
salt.modules.status.pid(sig) Return the PID or an empty string if the process is running or not.  Pass a signature to use to find the process via ps.  Note you can pass a Python-compatible regular expression to return all pids of processes matching the regexp.
salt '*' status.pid <sig>
salt.modules.status.ping_master(master) New in version 2016.3.0.
Sends ping request to the given master. Fires '__master_failback' event on success.  Returns bool result.
salt '*' status.ping_master localhost
salt.modules.status.procs() Return the process data
salt '*' status.procs
salt.modules.status.proxy_reconnect(proxy_name, opts=None) Forces proxy minion reconnection when not alive.
proxy_name The virtual name of the proxy module.
opts: None Opts dictionary. Not intended for CLI usage.
salt '*' status.proxy_reconnect rest_sample
salt.modules.status.time_(format='%A, %d. %B %Y %I:%M%p') New in version 2016.3.0.
Return the current time on the minion, formatted based on the format parameter.
Default date format: Monday, 27. July 2015 07:55AM
salt '*' status.time
salt '*' status.time '%s'
salt.modules.status.uptime() Return the uptime for this system.
Changed in version 2015.8.9: The uptime function was changed to return a dictionary of easy-to-read key/value pairs containing uptime information, instead of the output from a cmd.run call.
Changed in version 2016.11.0: Support for OpenBSD, FreeBSD, NetBSD, MacOS, and Solaris
salt '*' status.uptime
salt.modules.status.version() Return the system version for this minion
salt '*' status.version
salt.modules.status.vmstats() Changed in version 2016.3.2: Return the virtual memory stats for this minion
salt '*' status.vmstats
salt.modules.status.w() Return a list of logged in users for this minion, using the w command
salt '*' status.w
salt.modules.statuspage StatusPage Handle requests for the StatusPage API.
statuspage: api_key: <API_KEY> page_id: <PAGE_ID>
salt.modules.statuspage.create(endpoint='incidents', api_url=None, page_id=None, api_key=None, api_version=None, **kwargs) Insert a new entry under a specific endpoint.
endpoint: incidents Insert under this specific endpoint.
page_id Page ID. Can also be specified in the config file.
api_key API key. Can also be specified in the config file.
api_version: 1 API version. Can also be specified in the config file.
api_url Custom API URL in case the user has a StatusPage service running in a custom environment.
salt 'minion' statuspage.create endpoint='components' name='my component' group_id='993vgplshj12'
minion: ---------- comment: out: ---------- created_at: 2017-01-05T19:35:27.135Z description: None group_id: 993vgplshj12 id: mjkmtt5lhdgc name: my component page_id: ksdhgfyiuhaa position: 7 status: operational updated_at: 2017-01-05T19:35:27.135Z result: True
salt.modules.statuspage.delete(endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None) Remove an entry from an endpoint.
endpoint: incidents Request a specific endpoint.
salt 'minion' statuspage.delete endpoint='components' id='ftgks51sfs2d'
minion: ---------- comment: out: None result: True
salt.modules.statuspage.retrieve(endpoint='incidents', api_url=None, page_id=None, api_key=None, api_version=None) Retrieve a specific endpoint from the Statuspage API.
salt 'minion' statuspage.retrieve components
minion: ---------- comment: out: |_ ---------- backfilled: False created_at: 2015-01-26T20:25:02.702Z id: kh2qwjbheqdc36 impact: major impact_override: None incident_updates: |_ ---------- affected_components: None body: We are currently investigating this issue. created_at: 2015-01-26T20:25:02.849Z display_at: 2015-01-26T20:25:02.849Z id: zvx7xz2z5skr incident_id: kh2qwjbheqdc36 status: investigating twitter_updated_at: None updated_at: 2015-01-26T20:25:02.849Z wants_twitter_update: False monitoring_at: None name: just testing some stuff page_id: ksdhgfyiuhaa postmortem_body: None postmortem_body_last_updated_at: None postmortem_ignored: False postmortem_notified_subscribers: False postmortem_notified_twitter: False postmortem_published_at: None resolved_at: None scheduled_auto_completed: False scheduled_auto_in_progress: False scheduled_for: None scheduled_remind_prior: False scheduled_reminded_at: None scheduled_until: None shortlink: http://stspg.io/voY status: investigating updated_at: 2015-01-26T20:25:13.379Z result: True
salt.modules.statuspage.update(endpoint='incidents', id=None, api_url=None, page_id=None, api_key=None, api_version=None, **kwargs) Update attribute(s) of a specific endpoint.
id     The unique ID of the endpoint entry.
endpoint: incidents Endpoint name.
salt 'minion' statuspage.update id=dz959yz2nd4l status=resolved
minion: ---------- comment: out: ---------- created_at: 2017-01-03T15:25:30.718Z description: None group_id: 993vgplshj12 id: dz959yz2nd4l name: Management Portal page_id: xzwjjdw87vpf position: 11 status: resolved updated_at: 2017-01-05T15:34:27.676Z result: True
salt.modules.supervisord Provide the service module for system supervisord or supervisord in a virtualenv
salt.modules.supervisord.add(name, user=None, conf_file=None, bin_env=None) Activates any updates in config for process/group.
user   user to run supervisorctl as
conf_file path to supervisord config file
bin_env path to supervisorctl bin or path to virtualenv with supervisor installed
salt '*' supervisord.add <name>
salt.modules.supervisord.custom(command, user=None, conf_file=None, bin_env=None) Run any custom supervisord command
salt '*' supervisord.custom "mstop '*gunicorn*'"
salt.modules.supervisord.options(name, conf_file=None) New in version 2014.1.0.
Read the config file and return the config options for a given process
name   Name of the configured process
salt '*' supervisord.options foo
salt.modules.supervisord.remove(name, user=None, conf_file=None, bin_env=None) Removes process/group from active config
salt '*' supervisord.remove <name>
salt.modules.supervisord.reread(user=None, conf_file=None, bin_env=None) Reload the daemon's configuration files
salt '*' supervisord.reread
salt.modules.supervisord.restart(name='all', user=None, conf_file=None, bin_env=None) Restart the named service.  Process group names should not include a trailing asterisk.
salt '*' supervisord.restart <service> salt '*' supervisord.restart <group>:
salt.modules.supervisord.start(name='all', user=None, conf_file=None, bin_env=None) Start the named service.  Process group names should not include a trailing asterisk.
salt '*' supervisord.start <service> salt '*' supervisord.start <group>:
salt.modules.supervisord.status(name=None, user=None, conf_file=None, bin_env=None) List programs and its state
salt '*' supervisord.status
salt.modules.supervisord.status_bool(name, expected_state=None, user=None, conf_file=None, bin_env=None) Check for status of a specific supervisord process and return boolean result.
name   name of the process to check
expected_state search for a specific process state. If set to None - any process state will match.
salt '*' supervisord.status_bool nginx expected_state='RUNNING'
salt.modules.supervisord.status_raw(name=None, user=None, conf_file=None, bin_env=None) Display the raw output of status
salt '*' supervisord.status_raw
salt.modules.supervisord.stop(name='all', user=None, conf_file=None, bin_env=None) Stop the named service.  Process group names should not include a trailing asterisk.
salt '*' supervisord.stop <service> salt '*' supervisord.stop <group>:
salt.modules.supervisord.update(user=None, conf_file=None, bin_env=None, name=None) Reload config and add/remove/update as necessary
name   name of the process group to update. if none then update any process group that has changes
salt '*' supervisord.update
salt.modules.suse_apache Support for Apache
Please note: The functions in here are SUSE-specific. Placing them in this separate file will allow them to load only on SUSE systems, while still loading under the apache namespace.
salt.modules.suse_apache.a2dismod(mod) Runs a2dismod for the given mod.
salt.modules.suse_apache.a2enmod(mod) Runs a2enmod for the given mod.
salt.modules.suse_apache.check_mod_enabled(mod) Checks to see if the specific apache mod is enabled.
This will only be functional on operating systems that support a2enmod -l to list the enabled mods.
salt '*' apache.check_mod_enabled status
salt.modules.svn Subversion SCM
salt.modules.svn.add(cwd, targets, user=None, username=None, password=None, *opts) Add files to be tracked by the Subversion working-copy checkout
cwd    The path to the Subversion repository
targets None files and directories to pass to the command as arguments
user   None Run svn as a user other than what the minion runs as
username None Connect to the Subversion server as another user
password None Connect to the Subversion server with this password
salt '*' svn.add /path/to/repo /path/to/new/file
salt.modules.svn.checkout(cwd, remote, target=None, user=None, username=None, password=None, *opts) Download a working copy of the remote Subversion repository directory or file
remote None URL to checkout
target None The name to give the file or directory working copy Default: svn uses the remote basename
salt '*' svn.checkout /path/to/repo svn://remote/repo
salt.modules.svn.commit(cwd, targets=None, msg=None, user=None, username=None, password=None, *opts) Commit the current directory, files, or directories to the remote Subversion repository
targets None files and directories to pass to the command as arguments Default: svn uses '.'
msg    None Message to attach to the commit log
salt '*' svn.commit /path/to/repo
salt.modules.svn.diff(cwd, targets=None, user=None, username=None, password=None, *opts) Return the diff of the current directory, files, or directories from the remote Subversion repository
salt '*' svn.diff /path/to/repo
salt.modules.svn.export(cwd, remote, target=None, user=None, username=None, password=None, revision='HEAD', *opts) Create an unversioned copy of a tree.
remote None URL and path to file or directory checkout
salt '*' svn.export /path/to/repo svn://remote/repo
salt.modules.svn.info(cwd, targets=None, user=None, username=None, password=None, fmt='str') Display the Subversion information from the checkout.
targets None files, directories, and URLs to pass to the command as arguments svn uses '.' by default
fmt    str How to fmt the output from info.  (str, xml, list, dict)
salt '*' svn.info /path/to/svn/repo
salt.modules.svn.remove(cwd, targets, msg=None, user=None, username=None, password=None, *opts) Remove files and directories from the Subversion repository
targets None files, directories, and URLs to pass to the command as arguments
salt '*' svn.remove /path/to/repo /path/to/repo/remove
salt.modules.svn.status(cwd, targets=None, user=None, username=None, password=None, *opts) Display the status of the current directory, files, or directories in the Subversion repository
targets None files, directories, and URLs to pass to the command as arguments Default: svn uses '.'
salt '*' svn.status /path/to/repo
salt.modules.svn.switch(cwd, remote, target=None, user=None, username=None, password=None, *opts) New in version 2014.1.0.
Switch a working copy of a remote Subversion repository directory
remote None URL to switch
salt '*' svn.switch /path/to/repo svn://remote/repo
salt.modules.svn.update(cwd, targets=None, user=None, username=None, password=None, *opts) Update the current directory, files, or directories from the remote Subversion repository
salt '*' svn.update /path/to/repo
salt.modules.swarm Docker Swarm Module using Docker's Python SDK codeauthor Tyler Jones <jonestyler806@gmail.com>
The Docker Swarm Module is used to manage and create Docker Swarms.
Dependencies • Docker installed on the host
• Docker python sdk >= 2.5.1
Docker Python SDK pip install -U docker
More information: https://docker-py.readthedocs.io/en/stable/
salt.modules.swarm.joinswarm(remote_addr=<class 'int'>, listen_addr=<class 'int'>, token=<class 'str'>) Join a Swarm Worker to the cluster
remote_addr The manager node you want to connect to for the swarm
listen_addr Listen address used for inter-manager communication if the node gets promoted to manager, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP)
token  Either the manager join token or the worker join token. You can get the worker or manager token via salt '*' swarm.swarm_tokens
salt '*' swarm.joinswarm remote_addr=192.168.50.10 listen_addr='0.0.0.0'             token='SWMTKN-1-64tux2g0701r84ofq93zppcih0pe081akq45owe9ts61f30x4t-06trjugdu7x2z47j938s54il'
salt.modules.swarm.leave_swarm(force=<class 'bool'>) Force the minion to leave the swarm
force  Will force the minion/worker/manager to leave the swarm
salt '*' swarm.leave_swarm force=False
salt.modules.swarm.node_ls(server=<class 'str'>) Displays Information about Swarm Nodes with passing in the server
server The minion/server name
salt '*' swarm.node_ls server=minion1
salt.modules.swarm.remove_node(node_id=<class 'str'>, force=<class 'bool'>) Remove a node from a swarm and the target needs to be a swarm manager
node_id The node id from the return of swarm.node_ls
force  Forcefully remove the node/minion from the service
salt '*' swarm.remove_node node_id=z4gjbe9rwmqahc2a91snvolm5 force=false
salt.modules.swarm.remove_service(service=<class 'str'>) Remove Swarm Service
service The name of the service
salt '*' swarm.remove_service service=Test_Service
salt.modules.swarm.service_create(image=<class 'str'>, name=<class 'str'>, command=<class 'str'>, hostname=<class 'str'>, replicas=<class 'int'>, target_port=<class 'int'>, published_port=<class 'int'>) Create Docker Swarm Service Create
image  The docker image
name   Is the service name
command The docker command to run in the container at launch
hostname The hostname of the containers
replicas How many replicas you want running in the swarm
target_port The target port on the container
published_port port that's published on the host/os
salt '*' swarm.service_create image=httpd name=Test_Service             command=None hostname=salthttpd replicas=6 target_port=80 published_port=80
salt.modules.swarm.swarm_init(advertise_addr=<class 'str'>, listen_addr=<class 'int'>, force_new_cluster=<class 'bool'>) Initialize Docker on Minion as a Swarm Manager
advertise_addr The ip of the manager
listen_addr Listen address used for inter-manager communication, as well as determining the networking interface used for the VXLAN Tunnel Endpoint (VTEP).  This can either be an address/port combination in the form 192.168.1.1:4567, or an interface followed by a port number, like eth0:4567
force_new_cluster Force a new cluster if True is passed
salt '*' swarm.swarm_init advertise_addr='192.168.50.10' listen_addr='0.0.0.0' force_new_cluster=False
salt.modules.swarm.swarm_service_info(service_name=<class 'str'>) Swarm Service Information
service_name The name of the service that you want information on about the service
salt '*' swarm.swarm_service_info service_name=Test_Service
salt.modules.swarm.swarm_tokens() Get the Docker Swarm Manager or Worker join tokens
salt '*' swarm.swarm_tokens
salt.modules.swarm.update_node(availability=<class 'str'>, node_name=<class 'str'>, role=<class 'str'>, node_id=<class 'str'>, version=<class 'int'>) Updates docker swarm nodes/needs to target a manager node/minion
availability Drain or Active
node_name minion/node
role   role of manager or worker
node_id The Id and that can be obtained via swarm.node_ls
version Is obtained by swarm.node_ls
salt '*' swarm.update_node availability=drain node_name=minion2             role=worker node_id=3k9x7t8m4pel9c0nqr3iajnzp version=19
salt.modules.swift Module for handling OpenStack Swift calls Author: Anthony Stanton <‐ anthony.stanton@gmail.com>
Inspired by the S3 and Nova modules
• swiftclient Python module
configuration This module is not usable until the user, tenant, auth URL, and password or auth_key are specified either in a pillar or in the minion's config file.  For example:
keystone.user: admin keystone.tenant: admin keystone.auth_url: 'http://127.0.0.1:5000/v2.0/' keystone.password: verybadpass # or keystone.auth_key: 203802934809284k2j34lkj2l3kj43k
openstack1: keystone.user: admin keystone.tenant: admin keystone.auth_url: 'http://127.0.0.1:5000/v2.0/' keystone.password: verybadpass # or keystone.auth_key: 203802934809284k2j34lkj2l3kj43k
openstack2: keystone.user: admin keystone.tenant: admin keystone.auth_url: 'http://127.0.0.2:5000/v2.0/' keystone.password: verybadpass # or keystone.auth_key: 303802934809284k2j34lkj2l3kj43k
With this configuration in place, any of the swift functions can make use of a configuration profile by declaring it explicitly. For example:
salt '*' swift.get mycontainer myfile /tmp/file profile=openstack1
NOTE: For Rackspace cloud files setting keystone.auth_version = 1 is recommended.
salt.modules.swift.delete(cont, path=None, profile=None) Delete a container, or delete an object from a container.
CLI Example to delete a container:
salt myminion swift.delete mycontainer
CLI Example to delete an object from a container:
salt myminion swift.delete mycontainer remoteobject
salt.modules.swift.get(cont=None, path=None, local_file=None, return_bin=False, profile=None) List the contents of a container, or return an object from a container. Set return_bin to True in order to retrieve an object wholesale. Otherwise, Salt will attempt to parse an XML response.
CLI Example to list containers:
salt myminion swift.get
CLI Example to list the contents of a container:
salt myminion swift.get mycontainer
CLI Example to return the binary contents of an object:
salt myminion swift.get mycontainer myfile.png return_bin=True
CLI Example to save the binary contents of an object to a local file:
salt myminion swift.get mycontainer myfile.png local_file=/tmp/myfile.png
salt.modules.swift.head()
salt.modules.swift.put(cont, path=None, local_file=None, profile=None) Create a new container, or upload an object to a container.
CLI Example to create a container:
salt myminion swift.put mycontainer
CLI Example to upload an object to a container:
salt myminion swift.put mycontainer remotepath local_file=/path/to/file
salt.modules.sysbench The 'sysbench' module is used to analyze the performance of the minions, right from the master!  It measures various system parameters such as CPU, Memory, File I/O, Threads and Mutex.
salt.modules.sysbench.cpu() Tests for the CPU performance of minions.
salt '*' sysbench.cpu
salt.modules.sysbench.fileio() This tests for the file read and write operations Various modes of operations are
• sequential write
• sequential rewrite
• sequential read
• random read
• random write
• random read and write
The test works with 32 files with each file being 1Gb in size The test consumes a lot of time. Be patient!
salt '*' sysbench.fileio
salt.modules.sysbench.memory() This tests the memory for read and write operations.
salt '*' sysbench.memory
salt.modules.sysbench.mutex() Tests the implementation of mutex
salt '*' sysbench.mutex
salt.modules.sysbench.ping()
salt.modules.sysbench.threads() This tests the performance of the processor's scheduler
salt '*' sysbench.threads
salt.modules.sysfs Module for interfacing with SysFS
SEE ALSO: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt
salt.modules.sysfs.attr(key, value=None) Access/write a SysFS attribute.  If the attribute is a symlink, its destination is returned
Returns value or bool
salt '*' sysfs.attr block/sda/queue/logical_block_size
salt.modules.sysfs.interfaces(root) Generate a dictionary with all available interfaces relative to root.  Symlinks are not followed.
salt '*' sysfs.interfaces block/bcache0/bcache
{ "r": [ "state", "partial_stripes_expensive", "writeback_rate_debug", "stripe_size", "dirty_data", "stats_total/cache_hits", "stats_total/cache_bypass_misses", "stats_total/bypassed", "stats_total/cache_readaheads", "stats_total/cache_hit_ratio", "stats_total/cache_miss_collisions", "stats_total/cache_misses", "stats_total/cache_bypass_hits", ], "rw": [ "writeback_rate", "writeback_rate_update_seconds", "cache_mode", "writeback_delay", "label", "writeback_running", "writeback_metadata", "running", "writeback_rate_p_term_inverse", "sequential_cutoff", "writeback_percent", "writeback_rate_d_term", "readahead" ], "w": [ "stop", "clear_stats", "attach", "detach" ] }
• 'r' interfaces are read-only
• 'w' interfaces are write-only (e.g. actions)
• 'rw' are interfaces that can both be read or written
salt.modules.sysfs.read(key, root='') Read from SysFS
Parameters key -- file or path in SysFS; if key is a list then root will be prefixed on each key
Returns the full (tree of) SysFS attributes under key
salt '*' sysfs.read class/net/em1/statistics
salt.modules.sysfs.target(key, full=True) Return the basename of a SysFS key path
• key -- the location to resolve within SysFS
• full -- full path instead of basename
Returns fullpath or basename of path
salt '*' sysfs.read class/ttyS0
salt.modules.sysfs.write(key, value) Write a SysFS attribute/action
salt '*' sysfs.write devices/system/cpu/cpu0/cpufreq/scaling_governor 'performance'
salt.modules.syslog_ng Module for getting information about syslog-ng
maintainer Tibor Benke <btibi@sch.bme.hu>
depends cmd
This module is capable of managing syslog-ng instances which were installed via a package manager or from source. Users can use a directory as a parameter in the case of most functions, which contains the syslog-ng and syslog-ng-ctl binaries.
Syslog-ng can be installed via a package manager or from source. In the latter case, the syslog-ng and syslog-ng-ctl binaries are not available from the PATH, so users should set location of the sbin directory with syslog_ng.set_binary_path.
Similarly, users can specify the location of the configuration file with syslog_ng.set_config_file, then the module will use it. If it is not set, syslog-ng uses the default configuration file.
class salt.modules.syslog_ng.Argument(value='') A TypedParameterValue has one or more Arguments. For example this can be the value of key_file.
Does not need examples.
class salt.modules.syslog_ng.Buildable(iterable, join_body_on='', append_extra_newline=True) Base class of most classes, which have a build method.
It contains a common build function.
build() Builds the textual representation of the whole configuration object with its children.
build_body() Builds the body of a syslog-ng configuration object.
build_header() Builds the header of a syslog-ng configuration object.
build_tail() Builds the tail of a syslog-ng configuration object.
class salt.modules.syslog_ng.GivenStatement(value, add_newline=True)
This statement returns a string without modification. It can be used to use existing configuration snippets.
class salt.modules.syslog_ng.NamedStatement(type, id='', options=None) It represents a configuration statement, which has a name, e.g. a source.
class salt.modules.syslog_ng.Option(type='', params=None) A Statement class contains Option instances.
An instance of Option can represent a file(), tcp(), udp(), etc. option.
add_parameter(param)
class salt.modules.syslog_ng.Parameter(iterable=None, join_body_on='') An Option has one or more Parameter instances.
class salt.modules.syslog_ng.ParameterValue(iterable=None, join_body_on='') A TypedParameter can have one or more values.
class salt.modules.syslog_ng.SimpleParameter(value='') A Parameter is a SimpleParameter, if it's just a simple type, like a string.
destination d_file { file( '/var/log/messages' ); };
/var/log/messages is a SimpleParameter.
class salt.modules.syslog_ng.SimpleParameterValue(value='') A ParameterValuem which holds a simple type, like a string or a number.
For example in ip(127.0.0.1) 127.0.0.1 is a SimpleParameterValue.
class salt.modules.syslog_ng.Statement(type, id='', options=None, has_name=True) It represents a syslog-ng configuration statement, e.g. source, destination, filter.
add_child(option)
exception salt.modules.syslog_ng.SyslogNgError
class salt.modules.syslog_ng.TypedParameter(type='', values=None) A Parameter, which has a type:
destination d_tcp { tcp( ip(127.0.0.1) ); };
ip(127.0.0.1) is a TypedParameter.
add_value(value)
class salt.modules.syslog_ng.TypedParameterValue(type='', arguments=None) We have to go deeper...
A TypedParameter can have a 'parameter', which also have a type. For example key_file and cert_file:
source demo_tls_source { tcp( ip(0.0.0.0) port(1999) tls( key_file('/opt/syslog-ng/etc/syslog-ng/key.d/syslog-ng.key') cert_file('/opt/syslog-ng/etc/syslog-ng/cert.d/syslog-ng.cert') ) ); };
add_argument(arg)
class salt.modules.syslog_ng.UnnamedStatement(type, options=None) It represents a configuration statement, which doesn't have a name, e.g. a log path.
salt.modules.syslog_ng.config(name, config, write=True) Builds syslog-ng configuration. This function is intended to be used from the state module, users should not use it directly!
name : the id of the Salt document or it is the format of <statement name>.id config : the parsed YAML code write : if True, it writes  the config into the configuration file, otherwise just returns it
salt '*' syslog_ng.config name='s_local' config="[{'tcp':[{'ip':'127.0.0.1'},{'port':1233}]}]"
salt.modules.syslog_ng.config_test(syslog_ng_sbin_dir=None, cfgfile=None) Runs syntax check against cfgfile. If syslog_ng_sbin_dir is specified, it is added to the PATH during the test.
salt '*' syslog_ng.config_test salt '*' syslog_ng.config_test /home/user/install/syslog-ng/sbin salt '*' syslog_ng.config_test /home/user/install/syslog-ng/sbin /etc/syslog-ng/syslog-ng.conf
salt.modules.syslog_ng.get_config_file() Returns the configuration directory, which contains syslog-ng.conf.
salt '*' syslog_ng.get_config_file
salt.modules.syslog_ng.modules(syslog_ng_sbin_dir=None) Returns the available modules. If syslog_ng_sbin_dir is specified, it is added to the PATH during the execution of the command syslog-ng.
salt '*' syslog_ng.modules salt '*' syslog_ng.modules /home/user/install/syslog-ng/sbin
salt.modules.syslog_ng.reload_(name) Reloads syslog-ng. This function is intended to be used from states.
If syslog_ng.set_config_file, is called before, this function will use the set binary path.
salt '*' syslog_ng.reload
salt.modules.syslog_ng.set_binary_path(name) Sets the path, where the syslog-ng binary can be found. This function is intended to be used from states.
If syslog-ng is installed via a package manager, users don't need to use this function.
salt '*' syslog_ng.set_binary_path name=/usr/sbin
salt.modules.syslog_ng.set_config_file(name) Sets the configuration's name. This function is intended to be used from states.
salt '*' syslog_ng.set_config_file name=/etc/syslog-ng
salt.modules.syslog_ng.set_parameters(version=None, binary_path=None, config_file=None, *args, **kwargs) Sets variables.
salt '*' syslog_ng.set_parameters version='3.6' salt '*' syslog_ng.set_parameters  binary_path=/home/user/install/syslog-ng/sbin config_file=/home/user/install/syslog-ng/etc/syslog-ng.conf
salt.modules.syslog_ng.start(name=None, user=None, group=None, chroot=None, caps=None, no_caps=False, pidfile=None, enable_core=False, fd_limit=None, verbose=False, debug=False, trace=False, yydebug=False, persist_file=None, control=None, worker_threads=None) Ensures, that syslog-ng is started via the given parameters. This function is intended to be used from the state module.
Users shouldn't use this function, if the service module is available on their system. If syslog_ng.set_config_file, is called before, this function will use the set binary path.
salt '*' syslog_ng.start
salt.modules.syslog_ng.stats(syslog_ng_sbin_dir=None) Returns statistics from the running syslog-ng instance. If syslog_ng_sbin_dir is specified, it is added to the PATH during the execution of the command syslog-ng-ctl.
salt '*' syslog_ng.stats salt '*' syslog_ng.stats /home/user/install/syslog-ng/sbin
salt.modules.syslog_ng.stop(name=None) Kills syslog-ng. This function is intended to be used from the state module.
Users shouldn't use this function, if the service module is available on their system.  If syslog_ng.set_config_file is called before, this function will use the set binary path.
salt '*' syslog_ng.stop
salt.modules.syslog_ng.version(syslog_ng_sbin_dir=None) Returns the version of the installed syslog-ng. If syslog_ng_sbin_dir is specified, it is added to the PATH during the execution of the command syslog-ng.
salt '*' syslog_ng.version salt '*' syslog_ng.version /home/user/install/syslog-ng/sbin
salt.modules.syslog_ng.write_config(config, newlines=2) Writes the given parameter config into the config file. This function is intended to be used from states.
If syslog_ng.set_config_file, is called before, this function will use the set config file.
salt '*' syslog_ng.write_config config='# comment'
salt.modules.syslog_ng.write_version(name) Removes the previous configuration file, then creates a new one and writes the name line. This function is intended to be used from states.
salt '*' syslog_ng.write_version name="3.6"
salt.modules.sysmod The sys module provides information about the available functions on the minion
salt.modules.sysmod.argspec(module='') Return the argument specification of functions in Salt execution modules.
salt '*' sys.argspec pkg.install salt '*' sys.argspec sys salt '*' sys.argspec
Module names can be specified as globs.
salt '*' sys.argspec 'pkg.*'
salt.modules.sysmod.doc(*args) Return the docstrings for all modules. Optionally, specify a module or a function to narrow the selection.
The strings are aggregated into a single document on the master for easy reading.
Multiple modules/functions can be specified.
salt '*' sys.doc salt '*' sys.doc sys salt '*' sys.doc sys.doc salt '*' sys.doc network.traceroute user.info
Modules can be specified as globs.
salt '*' sys.doc 'sys.*' salt '*' sys.doc 'sys.list_*'
salt.modules.sysmod.list_functions(*args, **kwargs) List the functions for all modules. Optionally, specify a module or modules from which to list.
salt '*' sys.list_functions salt '*' sys.list_functions sys salt '*' sys.list_functions sys user
salt '*' sys.list_functions 'module.specific_function'
Function names can be specified as globs.
salt '*' sys.list_functions 'sys.list_*'
salt.modules.sysmod.list_modules(*args) List the modules loaded on the minion
salt '*' sys.list_modules
salt '*' sys.list_modules 's*'
salt.modules.sysmod.list_renderers(*args) List the renderers loaded on the minion
salt '*' sys.list_renderers
Render names can be specified as globs.
salt '*' sys.list_renderers 'yaml*'
salt.modules.sysmod.list_returner_functions(*args, **kwargs) List the functions for all returner modules. Optionally, specify a returner module or modules from which to list.
salt '*' sys.list_returner_functions salt '*' sys.list_returner_functions mysql salt '*' sys.list_returner_functions mysql etcd
Returner names can be specified as globs.
salt '*' sys.list_returner_functions 'sqlite3.get_*'
salt.modules.sysmod.list_returners(*args) List the returners loaded on the minion
salt '*' sys.list_returners
salt '*' sys.list_returners 's*'
salt.modules.sysmod.list_runner_functions(*args, **kwargs) List the functions for all runner modules. Optionally, specify a runner module or modules from which to list.
salt '*' sys.list_runner_functions salt '*' sys.list_runner_functions state salt '*' sys.list_runner_functions state virt
Runner function names can be specified as globs.
salt '*' sys.list_runner_functions 'state.*' 'virt.*'
salt.modules.sysmod.list_runners(*args) List the runners loaded on the minion
salt '*' sys.list_runners
Runner names can be specified as globs.
salt '*' sys.list_runners 'm*'
salt.modules.sysmod.list_state_functions(*args, **kwargs) List the functions for all state modules. Optionally, specify a state module or modules from which to list.
salt '*' sys.list_state_functions salt '*' sys.list_state_functions file salt '*' sys.list_state_functions pkg user
State function names can be specified as globs.
salt '*' sys.list_state_functions 'file.*' salt '*' sys.list_state_functions 'file.s*'
New in version 2016.9.
salt '*' sys.list_state_functions 'module.specific_function'
salt.modules.sysmod.list_state_modules(*args) List the modules loaded on the minion
salt '*' sys.list_state_modules
State module names can be specified as globs.
salt '*' sys.list_state_modules 'mysql_*'
salt.modules.sysmod.reload_modules() Tell the minion to reload the execution modules
salt '*' sys.reload_modules
salt.modules.sysmod.renderer_doc(*args) Return the docstrings for all renderers. Optionally, specify a renderer or a function to narrow the selection.
Multiple renderers can be specified.
salt '*' sys.renderer_doc salt '*' sys.renderer_doc cheetah salt '*' sys.renderer_doc jinja json
Renderer names can be specified as globs.
salt '*' sys.renderer_doc 'c*' 'j*'
salt.modules.sysmod.returner_argspec(module='') Return the argument specification of functions in Salt returner modules.
salt '*' sys.returner_argspec xmpp salt '*' sys.returner_argspec xmpp smtp salt '*' sys.returner_argspec
salt '*' sys.returner_argspec 'sqlite3.*'
salt.modules.sysmod.returner_doc(*args) Return the docstrings for all returners. Optionally, specify a returner or a function to narrow the selection.
Multiple returners/functions can be specified.
salt '*' sys.returner_doc salt '*' sys.returner_doc sqlite3 salt '*' sys.returner_doc sqlite3.get_fun salt '*' sys.returner_doc sqlite3.get_fun etcd.get_fun
salt '*' sys.returner_doc 'sqlite3.get_*'
salt.modules.sysmod.runner_argspec(module='') Return the argument specification of functions in Salt runner modules.
salt '*' sys.runner_argspec state salt '*' sys.runner_argspec http salt '*' sys.runner_argspec
salt '*' sys.runner_argspec 'winrepo.*'
salt.modules.sysmod.runner_doc(*args) Return the docstrings for all runners. Optionally, specify a runner or a function to narrow the selection.
Multiple runners/functions can be specified.
salt '*' sys.runner_doc salt '*' sys.runner_doc cache salt '*' sys.runner_doc cache.grains salt '*' sys.runner_doc cache.grains mine.get
salt '*' sys.runner_doc 'cache.clear_*'
salt.modules.sysmod.state_argspec(module='') Return the argument specification of functions in Salt state modules.
salt '*' sys.state_argspec pkg.installed salt '*' sys.state_argspec file salt '*' sys.state_argspec
State names can be specified as globs.
salt '*' sys.state_argspec 'pkg.*'
salt.modules.sysmod.state_doc(*args) Return the docstrings for all states. Optionally, specify a state or a function to narrow the selection.
Multiple states/functions can be specified.
salt '*' sys.state_doc salt '*' sys.state_doc service salt '*' sys.state_doc service.running salt '*' sys.state_doc service.running ipables.append
salt '*' sys.state_doc 'service.*' 'iptables.*'
salt.modules.sysmod.state_schema(module='') Return a JSON Schema for the given state function(s)
salt '*' sys.state_schema salt '*' sys.state_schema pkg.installed
salt.modules.sysrc sysrc module for FreeBSD
salt.modules.sysrc.get(**kwargs) Return system rc configuration variables
salt '*' sysrc.get includeDefaults=True
salt.modules.sysrc.remove(name, **kwargs) Remove system rc configuration variables
salt '*' sysrc.remove name=sshd_enable
salt.modules.sysrc.set_(name, value, **kwargs) Set system rc configuration variables
salt '*' sysrc.set name=sshd_flags value="-p 2222"
salt.modules.system Support for reboot, shutdown, etc on POSIX-like systems.
NOTE: If you have configured a wrapper such as molly-guard to intercept interactive shutdown commands, be aware that calling system.halt, system.poweroff, system.reboot, and system.shutdown with salt-call will hang indefinitely while the wrapper script waits for user input. Calling them with salt will work as expected.
salt.modules.system.get_computer_desc() Get PRETTY_HOSTNAME value stored in /etc/machine-info If this file doesn't exist or the variable doesn't exist return False.
Returns Value of PRETTY_HOSTNAME if this does not exist False.
salt '*' system.get_computer_desc
salt.modules.system.get_computer_name() Get hostname.
salt.modules.system.get_reboot_required_witnessed() Determine if at any time during the current boot session the salt minion witnessed an event indicating that a reboot is required.
Returns True if the a reboot request was witnessed, False otherwise
salt '*' system.get_reboot_required_witnessed
salt.modules.system.get_system_date(utc_offset=None) Get the system date
Parameters utc_offset (str) -- The utc offset in 4 digit (+0600) format with an optional sign (+/-).  Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets.
Returns Returns the system date.
salt '*' system.get_system_date
salt.modules.system.get_system_date_time(utc_offset=None) Get the system date/time.
Returns Returns the system time in YYYY-MM-DD hh:mm:ss format.
salt '*' system.get_system_date_time "'-0500'"
salt.modules.system.get_system_time(utc_offset=None) Get the system time.
Returns Returns the system time in HH:MM:SS AM/PM format.
salt '*' system.get_system_time
salt.modules.system.halt() Halt a running system
salt.modules.system.has_settable_hwclock() Returns True if the system has a hardware clock capable of being set from software.
salt '*' system.has_settable_hwclock
salt.modules.system.init(runlevel) Change the system runlevel on sysV compatible systems
salt.modules.system.poweroff() Poweroff a running system
salt.modules.system.reboot(at_time=None) Reboot the system
at_time The wait time in minutes before the system will be rebooted.
salt.modules.system.set_computer_desc(desc) Set PRETTY_HOSTNAME value stored in /etc/machine-info This will create the file if it does not exist. If it is unable to create or modify this file returns False.
Parameters desc (str) -- The computer description
Returns False on failure. True if successful.
salt '*' system.set_computer_desc "Michael's laptop"
salt.modules.system.set_computer_name(hostname) Modify hostname.
salt '*' system.set_computer_name master.saltstack.com
salt.modules.system.set_reboot_required_witnessed() This function is used to remember that an event indicating that a reboot is required was witnessed. This function writes to a temporary filesystem so the event gets cleared upon reboot.
salt '*' system.set_reboot_required_witnessed
salt.modules.system.set_system_date(newdate, utc_offset=None) Set the system date. Use <mm-dd-yy> format for the date.
Parameters newdate (str) --
The date to set. Can be any of the following formats:
• YYYY-MM-DD
• MM-DD-YYYY
• MM-DD-YY
• MM/DD/YYYY
• MM/DD/YY
• YYYY/MM/DD
salt '*' system.set_system_date '03-28-13'
salt.modules.system.set_system_date_time(years=None, months=None, days=None, hours=None, minutes=None, seconds=None, utc_offset=None) Set the system date and time. Each argument is an element of the date, but not required. If an element is not passed, the current system value for that element will be used. For example, if you don't pass the year, the current system year will be used. (Used by set_system_date and set_system_time)
Updates hardware clock, if present, in addition to software (kernel) clock.
• years (int) -- Years digit, ie: 2015
• months (int) -- Months digit: 1 - 12
• days (int) -- Days digit: 1 - 31
• hours (int) -- Hours digit: 0 - 23
• minutes (int) -- Minutes digit: 0 - 59
• seconds (int) -- Seconds digit: 0 - 59
• utc_offset (str) -- The utc offset in 4 digit (+0600) format with an optional sign (+/-).  Will default to None which will use the local timezone. To set the time based off of UTC use "'+0000'". Note: if being passed through the command line will need to be quoted twice to allow negative offsets.
Returns True if successful. Otherwise False.
salt '*' system.set_system_date_time 2015 5 12 11 37 53 "'-0500'"
salt.modules.system.set_system_time(newtime, utc_offset=None) Set the system time.
• newtime (str) --
The time to set. Can be any of the following formats.  - HH:MM:SS AM/PM - HH:MM AM/PM - HH:MM:SS (24 hour) - HH:MM (24 hour)
Note that the salt command line parser parses the date/time before we obtain the argument (preventing us from doing utc) Therefore the argument must be passed in as a string.  Meaning you may have to quote the text twice from the command line.
Returns Returns True if successful. Otherwise False.
salt '*' system.set_system_time "'11:20'"
salt.modules.system.shutdown(at_time=None) Shutdown a running system
at_time The wait time in minutes before the system will be shutdown.
salt '*' system.shutdown 5
salt.modules.system_profiler System Profiler Module
Interface with macOS's command-line System Profiler utility to get information about package receipts and installed applications.
salt.modules.system_profiler.applications() Return the results of a call to system_profiler -xml -detail full SPApplicationsDataType as a dictionary.  Top-level keys of the dictionary are the names of each set of install receipts, since there can be multiple receipts with the same name.  Contents of each key are a list of dictionaries.
Note that this can take a long time depending on how many applications are installed on the target Mac.
salt '*' systemprofiler.applications
salt.modules.system_profiler.receipts() Return the results of a call to system_profiler -xml -detail full SPInstallHistoryDataType as a dictionary.  Top-level keys of the dictionary are the names of each set of install receipts, since there can be multiple receipts with the same name.  Contents of each key are a list of dictionaries.
salt '*' systemprofiler.receipts
salt.modules.systemd_service Provides the service module for systemd
New in version 0.10.0.
IMPORTANT: This is an implementation of virtual 'service' module. As such, you must call it under the name 'service' and NOT 'systemd'. You can see that also in the examples below.
salt.modules.systemd_service.available(name) New in version 0.10.4.
Check that the given service is available taking into account template units.
salt.modules.systemd_service.disable(name, no_block=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 run by this function from the salt-minion daemon's control group. This is done to avoid a race condition in cases where the salt-minion service is restarted while a service is being modified. 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).
Disable the named service to not start when the system boots
no_block False Set to True to start the service using --no-block.
root   Enable/disable/mask unit files in the specified root directory
salt.modules.systemd_service.disabled(name, root=None) Return if the named service is disabled from starting on boot
salt.modules.systemd_service.enable(name, no_block=False, unmask=False, unmask_runtime=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 run by this function from the salt-minion daemon's control group. This is done to avoid a race condition in cases where the salt-minion service is restarted while a service is being modified. 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).
Enable the named service to start when the system boots
unmask False Set to True to remove an indefinite mask before attempting to enable the service.
New in version 2017.7.0: In previous releases, Salt would simply unmask a service before enabling. This behavior is no longer the default.
unmask_runtime False Set to True to remove a runtime mask before attempting to enable the service.
salt.modules.systemd_service.enabled(name, root=None, **kwargs) Return if the named service is enabled to start on boot
salt.modules.systemd_service.execs(root=None) New in version 2014.7.0.
Return a list of all files specified as ExecStart for all services.
salt '*' service.execs
salt.modules.systemd_service.firstboot(locale=None, locale_message=None, keymap=None, timezone=None, hostname=None, machine_id=None, root=None) New in version 3001.
Call systemd-firstboot to configure basic settings of the system
locale Set primary locale (LANG=)
locale_message Set message locale (LC_MESSAGES=)
keymap Set keymap
timezone Set timezone
hostname Set host name
machine_id Set machine ID
root   Operate on an alternative filesystem root
salt '*' service.firstboot keymap=jp locale=en_US.UTF-8
salt.modules.systemd_service.force_reload(name, no_block=True, unmask=False, unmask_runtime=False) 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 run by this function from the salt-minion daemon's control group. This is done to avoid a race condition in cases where the salt-minion service is restarted while a service is being modified. 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).
Force-reload the specified service with systemd
unmask False Set to True to remove an indefinite mask before attempting to force-reload the service.
New in version 2017.7.0: In previous releases, Salt would simply unmask a service before force-reloading. This behavior is no longer the default.
unmask_runtime False Set to True to remove a runtime mask before attempting to force-reload the service.